theme development – My custom taxonomies are not showing up in the admin menus

Question

I am offering an update to one of my old WordPress themes. I have already registered some custom taxonomies, but now I have a problem:

My taxonomies are not displayed in the navigation menus of the WordPress dashboard:

See this

This is my code:

if ( ! function_exists( 'nf_register_taxonomies' ) ) {
function nf_register_taxonomies() {
    // Directors
    $directors_labels = array(
        'name'              => __( 'Director', 'nf-languages' ),
        'singular_name'     => __( 'Director', 'nf-languages' ),
        'search_items'      => __( 'Search in Directors', 'nf-languages' ),
        'all_items'         => __( 'All Directors', 'nf-languages' ),
        'parent_item'       => __( 'Parent Director', 'nf-languages' ),
        'parent_item_colon' => __( 'Parent Director:', 'nf-languages' ),
        'edit_item'         => __( 'Edit Director', 'nf-languages' ),
        'update_item'       => __( 'Update Director', 'nf-languages' ),
        'add_new_item'      => __( 'Add New Director', 'nf-languages' ),
        'new_item_name'     => __( 'Director Name', 'nf-languages' ),
        'menu_name'         => __( 'Directors', 'nf-languages' ),
    );
    $directors_args   = array(
        'hierarchical'      => false,
        'labels'            => $directors_labels,
        'show_ui'           => true,
        'show_admin_column' => true,
        'show_in_rest'      => true,
        'show_in_menu'      => true,
        'show_in_nav_menus' => true,
        'query_var'         => true,
        'rewrite'           => array( 'slug' => 'director' ),
    );
    register_taxonomy( 'directors', array(
        'series',
        'movie'
    ),                 $directors_args );
}
add_action( 'init', 'nf_register_taxonomies', 0 );}

I have a clue but I don’t know what the problem is and how to solve it, my taxonomy name is “directors”, if I rename it to “director” the problem will be solved. But I don’t want to change the name of this taxonomy. Does anyone know how to solve this problem?

0
MAJ 1 month 2022-08-13T04:06:41-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse