From a33d4a8dc4da5210a7e2cea364680bea9e961b19 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 28 Apr 2011 11:17:09 +0000 Subject: [PATCH] Admin Bar: Add a Themes submenu under Appearance, for consistency. fixes #15931. git-svn-id: https://develop.svn.wordpress.org/trunk@17741 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/admin-bar.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index 4a00bfa606..9b665e1b21 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -218,14 +218,18 @@ function wp_admin_bar_comments_menu( $wp_admin_bar ) { * @since 3.1.0 */ function wp_admin_bar_appearance_menu( $wp_admin_bar ) { - if ( !current_user_can('switch_themes') ) + // You can have edit_theme_options but not switch_themes. + if ( ! current_user_can('switch_themes') && ! current_user_can( 'edit_theme_options' ) ) return; $wp_admin_bar->add_menu( array( 'id' => 'appearance', 'title' => __('Appearance'), 'href' => admin_url('themes.php') ) ); - if ( !current_user_can('edit_theme_options') ) + if ( ! current_user_can( 'edit_theme_options' ) ) return; + if ( current_user_can( 'switch_themes' ) ) + $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'themes', 'title' => __('Themes'), 'href' => admin_url('themes.php') ) ); + if ( current_theme_supports( 'widgets' ) ) $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'widgets', 'title' => __('Widgets'), 'href' => admin_url('widgets.php') ) ); @@ -235,7 +239,7 @@ function wp_admin_bar_appearance_menu( $wp_admin_bar ) { if ( current_theme_supports( 'custom-background' ) ) $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'background', 'title' => __('Background'), 'href' => admin_url('themes.php?page=custom-background') ) ); - if ( current_theme_supports( 'custom-header-uploads' ) ) + if ( current_theme_supports( 'custom-header' ) ) $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'header', 'title' => __('Header'), 'href' => admin_url('themes.php?page=custom-header') ) ); }