Make WordPress Core


Ignore:
Timestamp:
11/20/2014 03:28:55 PM (12 years ago)
Author:
ocean90
Message:

Customizer: Use deep-links for Backgrounds, Headers, and Widgets.

Replace links in admin menu and toolbar to Custom Background/Header screen with deep-links to the Customizer section.
On the Widgets screen display a link to the Customizer widgets panel.

props topher1kenobe, rzen, celloexpressions, westonruter
fixes #25569, #25571, #28032.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/menu.php

    r29206 r30459  
    153153        $customize_url = add_query_arg( 'return', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), 'customize.php' );
    154154        $submenu['themes.php'][6] = array( __( 'Customize' ), 'customize', $customize_url, '', 'hide-if-no-customize' );
    155         unset( $customize_url );
     155
    156156        if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) {
    157157                $submenu['themes.php'][10] = array(__( 'Menus' ), 'edit_theme_options', 'nav-menus.php');
    158158        }
     159
     160        if ( current_theme_supports( 'custom-header' ) && current_user_can( 'customize') ) {
     161                $customize_header_url = add_query_arg( 'autofocus[control]', 'header_image', $customize_url );
     162                $submenu['themes.php'][15] = array( __( 'Header' ), $appearance_cap, $customize_header_url, '', 'hide-if-no-customize' );
     163        }
     164
     165        if ( current_theme_supports( 'custom-background' ) && current_user_can( 'customize') ) {
     166                $customize_background_url = add_query_arg( 'autofocus[control]', 'background_image', $customize_url );
     167                $submenu['themes.php'][20] = array( __( 'Background' ), $appearance_cap, $customize_background_url, '', 'hide-if-no-customize' );
     168        }
     169
     170        unset( $customize_url );
    159171
    160172unset( $appearance_cap );
Note: See TracChangeset for help on using the changeset viewer.