Answer the question
In order to leave comments, you need to log in
Why does metabox confuse sections when editing a post?
I select the necessary categories and add an entry, the metabox looks like this:
When I edit a post it looks like this:
it leaves only the selected categories, and all other categories are displayed down.
I create a taxonomy like this:
add_action( 'init', 'create_specialty_taxonomies' );
function create_specialty_taxonomies(){
register_taxonomy('specialty', array('rating_applicants'), array(
'hierarchical' => true,
'labels' => array(
'name' => _x( 'Специальности', 'taxonomy general name' ),
'singular_name' => _x( 'Специальности', 'taxonomy singular name' ),
'search_items' => __( 'Поиск' ),
'all_items' => __( 'Cпециальности' ),
'parent_item' => __( 'Родительские' ),
'parent_item_colon' => __( 'Родительские:' ),
'edit_item' => __( 'Редактировать' ),
'update_item' => __( 'Обновить' ),
'add_new_item' => __( 'Добавить новый' ),
'new_item_name' => __( 'Название новый' ),
'menu_name' => __( 'Специальности' ),
),
'show_in_rest' => true,
//'publicly_queryable' => 'publicly_queryable',
'show_ui' => true,
'query_var' => true,
'rewrite' => array(
'slug' => 'rating',
'with_front' => true,
'hierarchical' => true
),
'meta_box_cb' => 'post_categories_meta_box',
'show_admin_column' => true,
'show_in_quick_edit' => true,
'sort' => true,
'_builtin' => true,
));
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question