Ticket #21413: 21413.diff
File 21413.diff, 5.0 KB (added by , 12 years ago) |
---|
-
wp-admin/admin-header.php
100 100 </script> 101 101 102 102 <?php 103 // If the customize-loader script is enqueued, make sure the customize 104 // body classes are correct as early as possible. 105 if ( wp_script_is( 'customize-loader', 'queue' ) && current_user_can( 'edit_theme_options' ) ) 103 // Make sure the customize body classes are correct as early as possible. 104 if ( current_user_can( 'edit_theme_options' ) ) 106 105 wp_customize_support_script(); 107 106 ?> 108 107 -
wp-admin/menu.php
129 129 130 130 $menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' ); 131 131 132 if ( current_user_can( 'switch_themes') ) { 133 $menu[60] = array( __('Appearance'), 'switch_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' ); 134 $submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.php'); 135 if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) 136 $submenu['themes.php'][10] = array(__('Menus'), 'edit_theme_options', 'nav-menus.php'); 137 } else { 138 $menu[60] = array( __('Appearance'), 'edit_theme_options', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' ); 139 $submenu['themes.php'][5] = array(__('Themes'), 'edit_theme_options', 'themes.php'); 140 if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) 141 $submenu['themes.php'][10] = array(__('Menus'), 'edit_theme_options', 'nav-menus.php' ); 142 } 132 $appearance_cap = current_user_can( 'switch_themes') ? 'switch_themes' : 'edit_theme_options'; 133 134 $menu[60] = array( __('Appearance'), $appearance_cap, 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' ); 135 $submenu['themes.php'][4] = array( __( 'Customize' ), $appearance_cap, 'customize.php', 'hide-if-no-customize' ); 136 $submenu['themes.php'][5] = array(__('Themes'), $appearance_cap, 'themes.php'); 137 if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) 138 $submenu['themes.php'][10] = array(__('Menus'), 'edit_theme_options', 'nav-menus.php'); 139 140 unset( $appearance_cap ); 143 141 144 142 // Add 'Editor' to the bottom of the Appearance menu. 145 143 if ( ! is_multisite() ) -
wp-admin/menu-header.php
53 53 $class[] = 'wp-has-submenu'; 54 54 $submenu_items = $submenu[$item[2]]; 55 55 } 56 56 57 57 if ( ( $parent_file && $item[2] == $parent_file ) || ( empty($typenow) && $self == $item[2] ) ) { 58 58 $class[] = ! empty( $submenu_items ) ? 'wp-has-current-submenu wp-menu-open' : 'current'; 59 59 } else { … … 80 80 if ( false !== strpos( $class, 'wp-menu-separator' ) ) { 81 81 echo '<div class="separator"></div>'; 82 82 } elseif ( $submenu_as_parent && ! empty( $submenu_items ) ) { 83 $submenu_items = array_values( $submenu_items ); // Re-index. 83 $temp_submenu_items = $submenu_items = array_values( $submenu_items ); // Re-index. 84 if ( 'customize.php' == $submenu_items[0][2] ) 85 $submenu_items[0][2] = 'themes.php'; 84 86 $menu_hook = get_plugin_page_hook( $submenu_items[0][2], $item[2] ); 85 87 $menu_file = $submenu_items[0][2]; 86 88 if ( false !== ( $pos = strpos( $menu_file, '?' ) ) ) … … 91 93 } else { 92 94 echo "\n\t<div class='wp-menu-image'><a href='{$submenu_items[0][2]}' tabindex='-1' aria-label='$aria_label'>$img</a></div>$arrow<a href='{$submenu_items[0][2]}'$class $aria_attributes>$title</a>"; 93 95 } 96 $submenu_items = $temp_submenu_items; 94 97 } elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) { 95 98 $menu_hook = get_plugin_page_hook( $item[2], 'admin.php' ); 96 99 $menu_file = $item[2]; … … 103 106 echo "\n\t<div class='wp-menu-image'><a href='{$item[2]}' tabindex='-1' aria-label='$aria_label'>$img</a></div>$arrow<a href='{$item[2]}'$class $aria_attributes>{$item[0]}</a>"; 104 107 } 105 108 } 106 109 107 110 if ( ! empty( $submenu_items ) ) { 108 111 echo "\n\t<div class='wp-submenu'><div class='wp-submenu-wrap'>"; 109 112 echo "<div class='wp-submenu-head'>{$item[0]}</div><ul>"; … … 137 140 ) { 138 141 $class[] = 'current'; 139 142 } 143 144 if ( ! empty( $sub_item[3] ) ) 145 $class[] = $sub_item[3]; 140 146 141 147 $class = $class ? ' class="' . join( ' ', $class ) . '"' : ''; 142 148 -
wp-admin/includes/menu.php
73 73 $new_parent = $first_sub[2]; 74 74 // If the first submenu is not the same as the assigned parent, 75 75 // make the first submenu the new parent. 76 if ( $new_parent != $old_parent ) {76 if ( $new_parent != $old_parent && 'customize.php' != $new_parent ) { 77 77 $_wp_real_parent_file[$old_parent] = $new_parent; 78 78 $menu[$id][2] = $new_parent; 79 79