Categories
CMS Mastering Development Wordpress

Invalid Menu Items [duplicate]

https://youtu.be/lME3lY-kNbA

I told the question on youtube video

also I tell the question here again:

I cant add my taxonomies to menu except 000 taxonomy.I dont know why but it works:

the error : invalid items… ( red showing as you can see on youtube video )

this one works:

function deneme() {

    // Add new taxonomy, make it hierarchical like categories
    //first do the translations part for GUI

        $labels = array(
            'name' => _x( '000', 'taxonomy general name' ),
            'singular_name' => _x( '000', 'taxonomy singular name' ),
            'search_items' =>  __( '000' ),
            'all_items' => __( 'All Locations' ),
            'parent_item' => __( 'Parent Locations' ),
            'parent_item_colon' => __( 'Parent Location:' ),
            'edit_item' => __( 'Edit Location' ),
            'update_item' => __( 'Update Location' ),
            'add_new_item' => __( 'Add New Location' ),
            'new_item_name' => __( 'New Topic Location' ),
            'menu_name' => __( '000' ),
        );

    // Now register the taxonomy

        register_taxonomy('000',array('post'), array(
            'hierarchical' => true,
            'labels' => $labels,
            'show_ui' => true,
            'show_admin_column' => true,
            'query_var' => true,
            'show_in_rest' => true,
            'rewrite' => true,
            'rewrite' => array( 'slug' => '000' ),
            'has_archive' => true,
        ));

    }

    add_action( 'init', 'deneme', 0 );

this one doesnt work:

// 2. ekleme

function masallah() {

// Add new taxonomy, make it hierarchical like categories
//first do the translations part for GUI

    $labels = array(
        'name' => _x( 'Districts', 'taxonomy general name' ),
        'singular_name' => _x( 'District', 'taxonomy singular name' ),
        'search_items' =>  __( 'Search Districts' ),
        'all_items' => __( 'All Districts' ),
        'parent_item' => __( 'Parent Districts' ),
        'parent_item_colon' => __( 'Parent District:' ),
        'edit_item' => __( 'Edit District' ),
        'update_item' => __( 'Update District' ),
        'add_new_item' => __( 'Add New District' ),
        'new_item_name' => __( 'New Topic District' ),
        'menu_name' => __( 'Districts' ),
    );

// Now register the taxonomy

    register_taxonomy('Districts',array('post'), array(
        'hierarchical' => true,
        'labels' => $labels,
        'show_ui' => true,
        'show_admin_column' => true,
        'query_var' => true,
        'show_in_rest' => true,
        'rewrite' => true,
        'rewrite' => array( 'slug' => 'districts' ),
        'has_archive' => true,
    ));

}

add_action( 'init', 'masallah', 0 );

Leave a Reply

Your email address will not be published. Required fields are marked *