Ticket #25569: 25569-25571.3.diff
File 25569-25571.3.diff, 4.9 KB (added by , 10 years ago) |
---|
-
src/wp-admin/css/admin-menu.css
diff --git src/wp-admin/css/admin-menu.css src/wp-admin/css/admin-menu.css index dd333f7..e3d70ab 100644
li#wp-admin-bar-menu-toggle { 610 610 display: none; 611 611 } 612 612 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 } 613 618 614 619 /* Auto-folding of the admin menu */ 615 620 @media only screen and (max-width: 960px) { -
src/wp-admin/menu.php
diff --git src/wp-admin/menu.php src/wp-admin/menu.php index 5fc718d..09f725e 100644
$menu[60] = array( __('Appearance'), $appearance_cap, 'themes.php', '', 'menu-to 152 152 153 153 $customize_url = add_query_arg( 'return', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), 'customize.php' ); 154 154 $submenu['themes.php'][6] = array( __( 'Customize' ), 'customize', $customize_url, '', 'hide-if-no-customize' ); 155 unset( $customize_url ); 155 156 156 if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) { 157 157 $submenu['themes.php'][10] = array(__( 'Menus' ), 'edit_theme_options', 'nav-menus.php'); 158 158 } 159 if ( current_theme_supports( 'custom-header' ) ) { 160 $customize_header_url = add_query_arg( 'autofocus[control]', 'header_image', $customize_url ); 161 $submenu['themes.php'][15] = array( __( 'Header' ), $appearance_cap, $customize_header_url, '', 'hide-if-no-customize' ); 162 } 163 if ( current_theme_supports( 'custom-background' ) ) { 164 $customize_background_url = add_query_arg( 'autofocus[control]', 'background_image', $customize_url ); 165 $submenu['themes.php'][20] = array( __( 'Background' ), $appearance_cap, $customize_background_url, '', 'hide-if-no-customize' ); 166 } 167 168 unset( $customize_url ); 159 169 160 170 unset( $appearance_cap ); 161 171 -
src/wp-includes/admin-bar.php
diff --git src/wp-includes/admin-bar.php src/wp-includes/admin-bar.php index 726c50a..a390b7e 100644
function wp_admin_bar_appearance_menu( $wp_admin_bar ) { 662 662 if ( ! current_user_can( 'edit_theme_options' ) ) 663 663 return; 664 664 665 $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 666 $customize_url = add_query_arg( 'url', urlencode( $current_url ), wp_customize_url() ); 665 667 if ( current_user_can( 'customize' ) ) { 666 $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];667 668 $wp_admin_bar->add_menu( array( 668 669 'parent' => 'appearance', 669 670 'id' => 'customize', 670 671 'title' => __('Customize'), 671 'href' => add_query_arg( 'url', urlencode( $current_url ), wp_customize_url() ),672 'href' => $customize_url, 672 673 'meta' => array( 673 674 'class' => 'hide-if-no-customize', 674 675 ), … … function wp_admin_bar_appearance_menu( $wp_admin_bar ) { 682 683 if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) 683 684 $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'menus', 'title' => __('Menus'), 'href' => admin_url('nav-menus.php') ) ); 684 685 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') ) ); 686 if ( current_theme_supports( 'custom-background' ) ) { 687 $wp_admin_bar->add_menu( array( 688 'parent' => 'appearance', 689 'id' => 'background', 690 'title' => __( 'Background' ), 691 'href' => admin_url( 'themes.php?page=custom-background' ), 692 'meta' => array( 693 'class' => 'hide-if-customize', 694 ), 695 ) ); 696 $wp_admin_bar->add_menu( array( 697 'parent' => 'appearance', 698 'id' => 'customize-background', 699 'title' => __( 'Background' ), 700 'href' => add_query_arg( urlencode( 'autofocus[control]' ), 'background_image', $customize_url ), // urlencode() needed due to #16859 701 'meta' => array( 702 'class' => 'hide-if-no-customize', 703 ), 704 ) ); 705 } 706 707 if ( current_theme_supports( 'custom-header' ) ) { 708 $wp_admin_bar->add_menu( array( 709 'parent' => 'appearance', 710 'id' => 'header', 711 'title' => __( 'Header' ), 712 'href' => admin_url( 'themes.php?page=custom-header' ), 713 'meta' => array( 714 'class' => 'hide-if-customize', 715 ), 716 ) ); 717 $wp_admin_bar->add_menu( array( 718 'parent' => 'appearance', 719 'id' => 'customize-header', 720 'title' => __( 'Header' ), 721 'href' => add_query_arg( urlencode( 'autofocus[control]' ), 'header_image', $customize_url ), // urlencode() needed due to #16859 722 'meta' => array( 723 'class' => 'hide-if-no-customize', 724 ), 725 ) ); 726 } 687 727 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') ) );690 728 } 691 729 692 730 /**