Make WordPress Core

Ticket #25571: 25571.diff

File 25571.diff, 2.2 KB (added by celloexpressions, 9 years ago)

Hide "Header" from admin bar when customizer is supported.

  • wp-includes/admin-bar.php

     
    660660        ) );
    661661        add_action( 'wp_before_admin_bar_render', 'wp_customize_support_script' );
    662662
    663         if ( current_theme_supports( 'widgets' )  )
    664                 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'widgets', 'title' => __('Widgets'), 'href' => admin_url('widgets.php') ) );
     663        if ( current_theme_supports( 'widgets' ) ) {
     664                $wp_admin_bar->add_menu( array(
     665                        'parent' => 'appearance',
     666                        'id'     => 'widgets',
     667                        'title'  => __('Widgets'),
     668                        'href'   => admin_url('widgets.php'),
     669                ) );
     670        }
    665671
    666         if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
    667                 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'menus', 'title' => __('Menus'), 'href' => admin_url('nav-menus.php') ) );
     672        if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) {
     673                $wp_admin_bar->add_menu( array(
     674                        'parent' => 'appearance',
     675                        'id'     => 'menus',
     676                        'title'  => __('Menus'),
     677                        'href'   => admin_url('nav-menus.php'),
     678                ) );
     679        }
    668680
    669         if ( current_theme_supports( 'custom-background' ) )
    670                 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'background', 'title' => __('Background'), 'href' => admin_url('themes.php?page=custom-background') ) );
     681        if ( current_theme_supports( 'custom-background' ) ) {
     682                $wp_admin_bar->add_menu( array(
     683                        'parent' => 'appearance',
     684                        'id'     => 'background',
     685                        'title'  => __('Background'),
     686                        'href'   => admin_url('themes.php?page=custom-background'),
     687                ) );
     688        }
    671689
    672         if ( current_theme_supports( 'custom-header' ) )
    673                 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'header', 'title' => __('Header'), 'href' => admin_url('themes.php?page=custom-header') ) );
     690        if ( current_theme_supports( 'custom-header' ) ) {
     691                $wp_admin_bar->add_menu( array(
     692                        'parent' => 'appearance',
     693                        'id'     => 'header',
     694                        'title'  => __('Header'),
     695                        'href'   => admin_url('themes.php?page=custom-header'),
     696                        'meta'   => array(
     697                                'class' => 'hide-if-customize',
     698                        ),
     699                ) );
     700        }
    674701}
    675702
    676703/**