I have created a custom taxonomy called Country
to collect posts (even from different categories) under country
terms. I used the following code, and I created terms with no problem:
function country_init() {
register_taxonomy(
'country',
'post',
array(
'label' => __( 'Country' ),
'show_ui' => true,
'update_count_callback' => '_update_post_term_count',
'show_admin_column' => true,
'show_in_nav_menus' => true,
'rewrite' => array( 'slug' => 'country' ),
'capabilities' => array(
'manage_terms' => 'manage_options',
'edit_terms' => 'manage_options',
'assign_terms' => 'edit_guides',
)
)
);
}
add_action( 'init', 'country_init' );
I am not able to choose those terms while creating a new post. The widget area shows the box named country
, but toggling nothing as in the following picture. And there are no country
boxes while creating menus or widgets.
Is there something wrong with the code?
capabilities
array and see if that changes anything..'hierarchical'
totrue
in my taxonomy definition to fix this problem.