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: https://develop.svn.wordpress.org/trunk@19153 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
ac8b90ade2
commit
21f89abdca
|
@ -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') ) );
|
||||
|
||||
|
|
Loading…
Reference in New Issue