• Resolved deuns26

    (@deuns26)


    Hello, I can’t remove the category submenu from the admin bar

    add_action( ‘admin_menu’, function () {
    if ( ! current_user_can( ‘manage_options’ ) ) {
    remove_submenu_page( ‘wpm-testimonial’, ‘wpm-testimonial-category&post_type=wpm-testimonial’ );

    }

    }, 999 );

    thx

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @deuns26,

    Please replace the code you added with this one:

    // Remove submenus
        function remove_submenu() {
            remove_submenu_page( 'edit.php?post_type=wpm-testimonial', 'edit-tags.php?taxonomy=wpm-testimonial-category&post_type=wpm-testimonial' );
    }
    add_action( 'admin_menu', 'remove_submenu', 999 );

    This will do it.

    All the best,
    Mihaela

    Thread Starter deuns26

    (@deuns26)

    Hello, sorry your code doesn’t work either.

    Hi @deuns26,

    Can you please send me a screenshot to see how you added that code?
    I just double checked it and it works on my end – it removes the Categories from the admin menu.

    Thank you,
    Mihaela

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove sub menu bare admin’ is closed to new replies.