WordPress.org

Make WordPress Core

Ticket #25571: 25569-25571.2.diff

File 25569-25571.2.diff, 3.4 KB (added by celloexpressions, 7 years ago)

With deep-linking.

  • src/wp-admin/css/admin-menu.css

     
    610610        display: none;
    611611}
    612612
     613/* Hide-if-customize for items we can't add classes to */
     614.customize-support #menu-appearance a[href="themes.php?page=custom-header"],
     615.customize-support #menu-appearance a[href="themes.php?page=custom-background"] {
     616        display: none;
     617}
    613618
    614619/* Auto-folding of the admin menu */
    615620@media only screen and (max-width: 960px) {
  • src/wp-admin/menu.php

     
    152152
    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        if ( current_theme_supports( 'custom-header' ) ) {
     160                $customize_header_url = add_query_arg( 'autofocus[section]', 'header_image', $customize_url );
     161                $submenu['themes.php'][15] = array( __( 'Header' ), $appearance_cap, $customize_header_url, '', 'hide-if-no-customize' ); // @todo deep-link
     162        }
     163        if ( current_theme_supports( 'custom-background' ) ) {
     164                $customize_background_url = add_query_arg( 'autofocus[section]', 'background_image', $customize_url );
     165                $submenu['themes.php'][20] = array( __( 'Background' ), $appearance_cap, $customize_background_url, '', 'hide-if-no-customize' ); // @todo deep-link
     166        }
    159167
     168        unset( $customize_url );
     169
    160170unset( $appearance_cap );
    161171
    162172// Add 'Editor' to the bottom of the Appearance menu.
  • src/wp-includes/admin-bar.php

     
    682682        if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
    683683                $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'menus', 'title' => __('Menus'), 'href' => admin_url('nav-menus.php') ) );
    684684
    685         if ( current_theme_supports( 'custom-background' ) )
    686                 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'background', 'title' => __('Background'), 'href' => admin_url('themes.php?page=custom-background') ) );
     685        if ( current_theme_supports( 'custom-background' ) ) {
     686                $wp_admin_bar->add_menu( array(
     687                        'parent' => 'appearance',
     688                        'id' => 'background',
     689                        'title' => __( 'Background' ),
     690                        'href' => admin_url( 'themes.php?page=custom-background' ),
     691                        'meta'   => array(
     692                                'class' => 'hide-if-customize',
     693                        ),
     694                ) );
     695        }
    687696
    688         if ( current_theme_supports( 'custom-header' ) )
    689                 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'header', 'title' => __('Header'), 'href' => admin_url('themes.php?page=custom-header') ) );
     697        if ( current_theme_supports( 'custom-header' ) ) {
     698                $wp_admin_bar->add_menu( array(
     699                        'parent' => 'appearance',
     700                        'id' => 'header',
     701                        'title' => __( 'Header' ),
     702                        'href' => admin_url( 'themes.php?page=custom-header' ),
     703                        'meta'   => array(
     704                                'class' => 'hide-if-customize',
     705                        ),
     706                ) );
     707        }
     708
    690709}
    691710
    692711/**