Fix caps logic in wp_admin_bar_appearance_menu(). Show Themes on either switch_themes or edit_theme_options, and the rest of the appearance items on edit_theme_options. Fixes #19150.

git-svn-id: http://svn.automattic.com/wordpress/trunk@19153 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
duck_ 2011-11-04 14:47:37 +00:00
parent 20af945d78
commit 375689175a
1 changed files with 2 additions and 6 deletions

View File

@ -574,16 +574,12 @@ function wp_admin_bar_comments_menu( $wp_admin_bar ) {
* @since 3.1.0
*/
function wp_admin_bar_appearance_menu( $wp_admin_bar ) {
// You can have edit_theme_options but not switch_themes.
if ( ! current_user_can('switch_themes') && ! current_user_can( 'edit_theme_options' ) )
return;
if ( current_user_can( 'switch_themes' ) || current_user_can( 'edit_theme_options' ) )
$wp_admin_bar->add_menu( array( 'parent' => 'site-name', 'id' => 'themes', 'title' => __('Themes'), 'href' => admin_url('themes.php') ) );
if ( ! current_user_can( 'edit_theme_options' ) )
return;
if ( current_user_can( 'switch_themes' ) )
$wp_admin_bar->add_menu( array( 'parent' => 'site-name', 'id' => 'themes', 'title' => __('Themes'), 'href' => admin_url('themes.php') ) );
if ( current_theme_supports( 'widgets' ) )
$wp_admin_bar->add_menu( array( 'parent' => 'site-name', 'id' => 'widgets', 'title' => __('Widgets'), 'href' => admin_url('widgets.php') ) );