Ticket #19245: 19245.diff
| File 19245.diff, 2.8 KB (added by nacin, 18 months ago) |
|---|
-
wp-includes/admin-bar.php
541 541 */ 542 542 function wp_admin_bar_appearance_menu( $wp_admin_bar ) { 543 543 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') ) ); 545 545 546 546 if ( ! current_user_can( 'edit_theme_options' ) ) 547 547 return; 548 548 549 549 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') ) ); 551 551 552 552 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') ) ); 554 554 555 555 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') ) ); 557 557 558 558 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') ) ); 560 560 } 561 561 562 562 /** -
wp-includes/class-wp-admin-bar.php
112 112 } 113 113 114 114 public function render() { 115 116 $back_compat = array( 117 'appearance' => 'site-name', 118 ); 119 115 120 // Link nodes to parents. 116 121 foreach ( $this->nodes as $node ) { 117 122 123 if ( isset( $back_compat[ $node->parent ] ) ) 124 $node->parent = $back_compat[ $node->parent ]; 125 118 126 // Handle root menu items 119 127 if ( empty( $node->parent ) ) { 120 128 $parent = $this->root;
