Ticket #21413: 21413.2.diff
File 21413.2.diff, 7.3 KB (added by , 12 years ago) |
---|
-
wp-admin/admin-header.php
98 98 </script> 99 99 100 100 <?php 101 // If the customize-loader script is enqueued, make sure the customize 102 // body classes are correct as early as possible. 103 if ( wp_script_is( 'customize-loader', 'queue' ) && current_user_can( 'edit_theme_options' ) ) 101 // Make sure the customize body classes are correct as early as possible. 102 if ( current_user_can( 'edit_theme_options' ) ) 104 103 wp_customize_support_script(); 105 104 ?> 106 105 -
wp-admin/css/wp-admin-rtl.css
1305 1305 margin-right: -330px; 1306 1306 } 1307 1307 1308 .theme-options .load-customize {1309 margin-right: 0;1310 margin-left: 30px;1311 float: right;1312 }1313 1314 1308 .theme-options span { 1315 1309 float: right; 1316 1310 margin-right: 0; 1317 1311 margin-left: 10px; 1318 1312 } 1319 1313 1320 .theme-options ul { 1314 .theme-options ul, 1315 .theme-options .load-customize { 1321 1316 float: right; 1322 1317 } 1323 1318 -
wp-admin/css/wp-admin.css
4759 4759 padding-bottom: 10px; 4760 4760 } 4761 4761 4762 .theme-options .load-customize {4763 margin-right: 30px;4764 float: left;4765 }4766 4767 4762 .theme-options span { 4768 4763 float: left; 4769 4764 margin-right: 10px; … … 4773 4768 color: #999; 4774 4769 } 4775 4770 4776 .theme-options ul { 4771 .theme-options ul, 4772 .theme-options .load-customize { 4777 4773 float: left; 4778 4774 margin: 0; 4779 4775 } -
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 -
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 { … … 82 82 if ( false !== strpos( $class, 'wp-menu-separator' ) ) { 83 83 echo '<div class="separator"></div>'; 84 84 } elseif ( $submenu_as_parent && ! empty( $submenu_items ) ) { 85 $submenu_items = array_values( $submenu_items ); // Re-index. 85 $temp_submenu_items = $submenu_items = array_values( $submenu_items ); // Re-index. 86 if ( 'customize.php' == $submenu_items[0][2] ) 87 $submenu_items[0][2] = 'themes.php'; 86 88 $menu_hook = get_plugin_page_hook( $submenu_items[0][2], $item[2] ); 87 89 $menu_file = $submenu_items[0][2]; 88 90 if ( false !== ( $pos = strpos( $menu_file, '?' ) ) ) … … 93 95 } else { 94 96 echo "\n\t<a href='{$submenu_items[0][2]}'$class $aria_attributes>$arrow<div class='wp-menu-image'>$img</div><div class='wp-menu-name'>$title</div></a>"; 95 97 } 98 $submenu_items = $temp_submenu_items; 96 99 } elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) { 97 100 $menu_hook = get_plugin_page_hook( $item[2], 'admin.php' ); 98 101 $menu_file = $item[2]; … … 105 108 echo "\n\t<a href='{$item[2]}'$class $aria_attributes>$arrow<div class='wp-menu-image'>$img</div><div class='wp-menu-name'>{$item[0]}</div></a>"; 106 109 } 107 110 } 108 111 109 112 if ( ! empty( $submenu_items ) ) { 110 113 echo "\n\t<ul class='wp-submenu wp-submenu-wrap'>"; 111 114 echo "<li class='wp-submenu-head'>{$item[0]}</li>"; … … 140 143 ) { 141 144 $class[] = 'current'; 142 145 } 146 147 if ( ! empty( $sub_item[3] ) ) 148 $class[] = $sub_item[3]; 143 149 144 150 $class = $class ? ' class="' . join( ' ', $class ) . '"' : ''; 145 151 -
wp-admin/menu.php
136 136 137 137 $menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' ); 138 138 139 if ( current_user_can( 'switch_themes') ) { 140 $menu[60] = array( __('Appearance'), 'switch_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'none' ); 141 $submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.php'); 142 if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) 143 $submenu['themes.php'][10] = array(__('Menus'), 'edit_theme_options', 'nav-menus.php'); 144 } else { 145 $menu[60] = array( __('Appearance'), 'edit_theme_options', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'none' ); 146 $submenu['themes.php'][5] = array(__('Themes'), 'edit_theme_options', 'themes.php'); 147 if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) 148 $submenu['themes.php'][10] = array(__('Menus'), 'edit_theme_options', 'nav-menus.php' ); 149 } 139 $appearance_cap = current_user_can( 'switch_themes') ? 'switch_themes' : 'edit_theme_options'; 140 141 $menu[60] = array( __('Appearance'), $appearance_cap, 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' ); 142 $submenu['themes.php'][4] = array( __( 'Customize' ), $appearance_cap, 'customize.php', 'hide-if-no-customize' ); 143 $submenu['themes.php'][5] = array(__( 'Themes' ), $appearance_cap, 'themes.php'); 144 if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) 145 $submenu['themes.php'][10] = array(__( 'Menus' ), 'edit_theme_options', 'nav-menus.php'); 150 146 147 unset( $appearance_cap ); 148 151 149 // Add 'Editor' to the bottom of the Appearance menu. 152 150 if ( ! is_multisite() ) 153 151 add_action('admin_menu', '_add_themes_utility_last', 101); -
wp-admin/themes.php
161 161 $class = ''; 162 162 if ( 'themes.php' == $item[2] || 'theme-editor.php' == $item[2] ) 163 163 continue; 164 if ( 'customize.php' == $item[2] ) { 165 if ( current_user_can( 'edit_theme_options' ) ) 166 $class = ' class="load-customize hide-if-no-customize"'; 167 else 168 continue; 169 } 164 170 // 0 = name, 1 = capability, 2 = file 165 171 if ( ( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file)) ) 166 172 $class = ' class="current"'; … … 187 193 if ( $options || current_user_can( 'edit_theme_options' ) ) : 188 194 ?> 189 195 <div class="theme-options"> 190 <?php if ( current_user_can( 'edit_theme_options' ) ) : ?> 191 <a id="customize-current-theme-link" href="<?php echo wp_customize_url(); ?>" class="load-customize hide-if-no-customize" title="<?php echo esc_attr( $customize_title ); ?>"><?php _e( 'Customize' ); ?></a> 192 <?php 193 endif; // edit_theme_options 194 if ( $options ) : 195 ?> 196 <?php if ( $options ) : ?> 196 197 <span><?php _e( 'Options:' )?></span> 197 198 <ul> 198 199 <?php foreach ( $options as $option ) : ?>