Ticket #25569: 25569-25571.4.diff
File 25569-25571.4.diff, 5.0 KB (added by , 10 years ago) |
---|
-
src/wp-admin/css/admin-menu.css
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
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 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 ); 171 160 172 unset( $appearance_cap ); 161 173 162 174 // Add 'Editor' to the bottom of the Appearance menu. -
src/wp-includes/admin-bar.php
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 ), … … 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 ) ); 687 696 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_user_can( 'customize' ) ) { 698 $wp_admin_bar->add_menu( array( 699 'parent' => 'appearance', 700 'id' => 'customize-background', 701 'title' => __( 'Background' ), 702 'href' => add_query_arg( urlencode( 'autofocus[control]' ), 'background_image', $customize_url ), // urlencode() needed due to #16859 703 'meta' => array( 704 'class' => 'hide-if-no-customize', 705 ), 706 ) ); 707 } 708 } 709 710 if ( current_theme_supports( 'custom-header' ) ) { 711 $wp_admin_bar->add_menu( array( 712 'parent' => 'appearance', 713 'id' => 'header', 714 'title' => __( 'Header' ), 715 'href' => admin_url( 'themes.php?page=custom-header' ), 716 'meta' => array( 717 'class' => 'hide-if-customize', 718 ), 719 ) ); 720 721 if ( current_user_can( 'customize' ) ) { 722 $wp_admin_bar->add_menu( array( 723 'parent' => 'appearance', 724 'id' => 'customize-header', 725 'title' => __( 'Header' ), 726 'href' => add_query_arg( urlencode( 'autofocus[control]' ), 'header_image', $customize_url ), // urlencode() needed due to #16859 727 'meta' => array( 728 'class' => 'hide-if-no-customize', 729 ), 730 ) ); 731 } 732 } 733 690 734 } 691 735 692 736 /**