Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter amadhavan

    (@amadhavan)

    I added this to my functions.php

    //hide theme and customize on admin bar and backend for anyone that is not an admin
    if ( !is_super_admin() ) {
    add_action( 'wp_before_admin_bar_render', 'admin_bar_hide' );
    add_action('admin_menu', 'customize_admin_menu_hide', 999);
    
    }
    function admin_bar_hide()
    {
        global $wp_admin_bar;
    
        $wp_admin_bar->remove_menu('customize');
    	$wp_admin_bar->remove_node( 'themes' );
    }
    
    function customize_admin_menu_hide(){
    
    global $submenu;
    // Appearance customize Menu
    unset($submenu['themes.php'][6]);	
    
    }

    Plugin Author Frank Bueltge

    (@bueltge)

    It is right. The Customizer link is dynamically and the current system can’t hide this. I have update the plugin to support this type of menu items.

    Please see this issue, same topic – https://wordpress.org/support/topic/cant-hide-customize-header-and-background-sub-menu-items?replies=8

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How do I hide from Admin toolbar’ is closed to new replies.