Does anyone know if there is a way to handle a custom taxonomy for the nav_menu_item
built'in post type?
When I assign my custom taxonomy to this post type, i don't see any change in the menu editor...
It works well with posts
, pages
and custom post types
.
Here how I've registered my custom taxonomy:
add_action( 'init', 'my_region_taxo', 0 );
function my_region_taxo() {
$labels = array(
'name' => _x( 'Regions', 'Taxonomy General Name', 'my-text-domain' ),
'singular_name' => _x( 'Region', 'Taxonomy Singular Name', 'my-text-domain' ),
(...)
);
$rewrite = array(
'slug' => 'region',
'with_front' => true,
'hierarchical' => true,
);
$args = array(
'labels' => $labels,
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => false,
'show_tagcloud' => false,
'rewrite' => $rewrite,
'show_in_rest' => true,
);
register_taxonomy(
'my_region_taxonomy',
array(
'post',
'page',
'nav_menu_item'
),
$args
);
}