]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/menu.php
WordPress 4.1.2-scripts
[autoinstalls/wordpress.git] / wp-admin / menu.php
index 5fc718d5328f23f974ab2cc1a70247502ee76f9c..89c13d96840b61f4ad8d72550c0d7b6956e629ac 100644 (file)
@@ -152,11 +152,23 @@ $menu[60] = array( __('Appearance'), $appearance_cap, 'themes.php', '', 'menu-to
 
        $customize_url = add_query_arg( 'return', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), 'customize.php' );
        $submenu['themes.php'][6] = array( __( 'Customize' ), 'customize', $customize_url, '', 'hide-if-no-customize' );
-       unset( $customize_url );
+
        if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) {
                $submenu['themes.php'][10] = array(__( 'Menus' ), 'edit_theme_options', 'nav-menus.php');
        }
 
+       if ( current_theme_supports( 'custom-header' ) && current_user_can( 'customize') ) {
+               $customize_header_url = add_query_arg( 'autofocus[control]', 'header_image', $customize_url );
+               $submenu['themes.php'][15] = array( __( 'Header' ), $appearance_cap, $customize_header_url, '', 'hide-if-no-customize' );
+       }
+
+       if ( current_theme_supports( 'custom-background' ) && current_user_can( 'customize') ) {
+               $customize_background_url = add_query_arg( 'autofocus[control]', 'background_image', $customize_url );
+               $submenu['themes.php'][20] = array( __( 'Background' ), $appearance_cap, $customize_background_url, '', 'hide-if-no-customize' );
+       }
+
+       unset( $customize_url );
+
 unset( $appearance_cap );
 
 // Add 'Editor' to the bottom of the Appearance menu.
@@ -194,19 +206,21 @@ else
 if ( current_user_can('list_users') ) {
        $_wp_real_parent_file['profile.php'] = 'users.php'; // Back-compat for plugins adding submenus to profile.php.
        $submenu['users.php'][5] = array(__('All Users'), 'list_users', 'users.php');
-       if ( current_user_can('create_users') )
+       if ( current_user_can( 'create_users' ) ) {
                $submenu['users.php'][10] = array(_x('Add New', 'user'), 'create_users', 'user-new.php');
-       else
+       } elseif ( is_multisite() ) {
                $submenu['users.php'][10] = array(_x('Add New', 'user'), 'promote_users', 'user-new.php');
+       }
 
        $submenu['users.php'][15] = array(__('Your Profile'), 'read', 'profile.php');
 } else {
        $_wp_real_parent_file['users.php'] = 'profile.php';
        $submenu['profile.php'][5] = array(__('Your Profile'), 'read', 'profile.php');
-       if ( current_user_can('create_users') )
+       if ( current_user_can( 'create_users' ) ) {
                $submenu['profile.php'][10] = array(__('Add New User'), 'create_users', 'user-new.php');
-       else
+       } elseif ( is_multisite() ) {
                $submenu['profile.php'][10] = array(__('Add New User'), 'promote_users', 'user-new.php');
+       }
 }
 
 $menu[75] = array( __('Tools'), 'edit_posts', 'tools.php', '', 'menu-top menu-icon-tools', 'menu-tools', 'dashicons-admin-tools' );