WordPress.org

Make WordPress Core

Ticket #19245: 19245.diff

File 19245.diff, 2.8 KB (added by nacin, 3 years ago)
  • wp-includes/admin-bar.php

     
    541541 */ 
    542542function wp_admin_bar_appearance_menu( $wp_admin_bar ) { 
    543543        if ( current_user_can( 'switch_themes' ) || current_user_can( 'edit_theme_options' ) ) 
    544                 $wp_admin_bar->add_menu( array( 'parent' => 'site-name', 'id' => 'themes', 'title' => __('Themes'), 'href' => admin_url('themes.php') ) ); 
     544                $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'themes', 'title' => __('Themes'), 'href' => admin_url('themes.php') ) ); 
    545545 
    546546        if ( ! current_user_can( 'edit_theme_options' ) ) 
    547547                return; 
    548548 
    549549        if ( current_theme_supports( 'widgets' )  ) 
    550                 $wp_admin_bar->add_menu( array( 'parent' => 'site-name', 'id' => 'widgets', 'title' => __('Widgets'), 'href' => admin_url('widgets.php') ) ); 
     550                $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'widgets', 'title' => __('Widgets'), 'href' => admin_url('widgets.php') ) ); 
    551551 
    552552         if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) 
    553                 $wp_admin_bar->add_menu( array( 'parent' => 'site-name', 'id' => 'menus', 'title' => __('Menus'), 'href' => admin_url('nav-menus.php') ) ); 
     553                $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'menus', 'title' => __('Menus'), 'href' => admin_url('nav-menus.php') ) ); 
    554554 
    555555        if ( current_theme_supports( 'custom-background' ) ) 
    556                 $wp_admin_bar->add_menu( array( 'parent' => 'site-name', 'id' => 'background', 'title' => __('Background'), 'href' => admin_url('themes.php?page=custom-background') ) ); 
     556                $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'background', 'title' => __('Background'), 'href' => admin_url('themes.php?page=custom-background') ) ); 
    557557 
    558558        if ( current_theme_supports( 'custom-header' ) ) 
    559                 $wp_admin_bar->add_menu( array( 'parent' => 'site-name', 'id' => 'header', 'title' => __('Header'), 'href' => admin_url('themes.php?page=custom-header') ) ); 
     559                $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'header', 'title' => __('Header'), 'href' => admin_url('themes.php?page=custom-header') ) ); 
    560560} 
    561561 
    562562/** 
  • wp-includes/class-wp-admin-bar.php

     
    112112        } 
    113113 
    114114        public function render() { 
     115 
     116                $back_compat = array( 
     117                        'appearance' => 'site-name', 
     118                ); 
     119 
    115120                // Link nodes to parents. 
    116121                foreach ( $this->nodes as $node ) { 
    117122 
     123                        if ( isset( $back_compat[ $node->parent ] ) ) 
     124                                $node->parent = $back_compat[ $node->parent ]; 
     125 
    118126                        // Handle root menu items 
    119127                        if ( empty( $node->parent ) ) { 
    120128                                $parent = $this->root;