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:
parent
20af945d78
commit
375689175a
|
@ -574,16 +574,12 @@ function wp_admin_bar_comments_menu( $wp_admin_bar ) {
|
||||||
* @since 3.1.0
|
* @since 3.1.0
|
||||||
*/
|
*/
|
||||||
function wp_admin_bar_appearance_menu( $wp_admin_bar ) {
|
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' ) )
|
||||||
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') ) );
|
||||||
return;
|
|
||||||
|
|
||||||
if ( ! current_user_can( 'edit_theme_options' ) )
|
if ( ! current_user_can( 'edit_theme_options' ) )
|
||||||
return;
|
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' ) )
|
if ( current_theme_supports( 'widgets' ) )
|
||||||
$wp_admin_bar->add_menu( array( 'parent' => 'site-name', 'id' => 'widgets', 'title' => __('Widgets'), 'href' => admin_url('widgets.php') ) );
|
$wp_admin_bar->add_menu( array( 'parent' => 'site-name', 'id' => 'widgets', 'title' => __('Widgets'), 'href' => admin_url('widgets.php') ) );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue