From 65a9b982469b4f5afd87af56baa7d0821ab4c6f8 Mon Sep 17 00:00:00 2001 From: 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: http://svn.automattic.com/wordpress/trunk@17741 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 4a00bfa60..9b665e1b2 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') ) ); }