WordPress.org

Make WordPress Core

Changeset 17741


Ignore:
Timestamp:
04/28/2011 11:17:09 AM (10 years ago)
Author:
nacin
Message:

Admin Bar: Add a Themes submenu under Appearance, for consistency. fixes #15931.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/admin-bar.php

    r17731 r17741  
    219219 */
    220220function wp_admin_bar_appearance_menu( $wp_admin_bar ) {
    221     if ( !current_user_can('switch_themes') )
     221    // You can have edit_theme_options but not switch_themes.
     222    if ( ! current_user_can('switch_themes') && ! current_user_can( 'edit_theme_options' ) )
    222223        return;
    223224
    224225    $wp_admin_bar->add_menu( array( 'id' => 'appearance', 'title' => __('Appearance'), 'href' => admin_url('themes.php') ) );
    225226
    226     if ( !current_user_can('edit_theme_options') )
    227         return;
     227    if ( ! current_user_can( 'edit_theme_options' ) )
     228        return;
     229
     230    if ( current_user_can( 'switch_themes' ) )
     231        $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'themes', 'title' => __('Themes'), 'href' => admin_url('themes.php') ) );
    228232
    229233    if ( current_theme_supports( 'widgets' )  )
     
    236240        $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'background', 'title' => __('Background'), 'href' => admin_url('themes.php?page=custom-background') ) );
    237241
    238     if ( current_theme_supports( 'custom-header-uploads' ) )
     242    if ( current_theme_supports( 'custom-header' ) )
    239243        $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'header', 'title' => __('Header'), 'href' => admin_url('themes.php?page=custom-header') ) );
    240244}
Note: See TracChangeset for help on using the changeset viewer.