WordPress.org

Ready to get started?Download WordPress

Forums

hiding sub menu in admin panel (1 post)

  1. Alvaro
    Member
    Posted 2 years ago #

    Hello All
    I am trying to hide menu and submenu from admin panel. I got success in hiding the default menu, I have created a taxonomy ( gallery) for page, post and one custom page called as portfolio
    Now I need to hide the taxonomy galleries for page,post and portfolio.
    Please let me out in writting the code for that,
    The code I am using to hide other sub menu is

    add_action( 'admin_menu', 'alvaro_remove_menus', 999 );
    
    function alvaro_remove_menus() {
    
    remove_submenu_page( 'index.php', 'update-core.php' );
    remove_submenu_page( 'edit.php', 'edit-tags.php?taxonomy=post_tag' );
    remove_submenu_page( 'edit.php', 'edit-tags.php?taxonomy=gallery' );
    
    }

    I tried with the below code to hide gallery from page sub menu but its not working
    remove_submenu_page( 'edit.php', 'edit-tags.php?taxonomy=gallery&post_type=page' );

    Thanks in advance

Topic Closed

This topic has been closed to new replies.

About this Topic