Revert [23871] - Customize should be added to the menu, but not hacked in as first. see #21413.

git-svn-id: http://core.svn.wordpress.org/trunk@24048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-04-22 19:33:39 +00:00
parent 0fa23c1ac2
commit b11654ce74
6 changed files with 28 additions and 27 deletions

View File

@ -1317,14 +1317,19 @@ h3.available-themes {
margin-right: -330px;
}
.theme-options .load-customize {
margin-right: 0;
margin-left: 30px;
float: right;
}
.theme-options span {
float: right;
margin-right: 0;
margin-left: 10px;
}
.theme-options ul,
.theme-options .load-customize {
.theme-options ul {
float: right;
}

View File

@ -5515,6 +5515,11 @@ h3.available-themes {
padding-bottom: 10px;
}
.theme-options .load-customize {
margin-right: 30px;
float: left;
}
.theme-options span {
float: left;
margin-right: 10px;
@ -5524,8 +5529,7 @@ h3.available-themes {
color: #999;
}
.theme-options ul,
.theme-options .load-customize {
.theme-options ul {
float: left;
margin: 0;
}
@ -6455,8 +6459,7 @@ body.full-overlay-active {
.no-customize-support.wp-core-ui .hide-if-no-customize,
.no-customize-support .wp-core-ui .hide-if-no-customize,
.customize-support.wp-core-ui .hide-if-customize,
.customize-support .wp-core-ui .hide-if-customize,
.no-customize-support .theme-options ul li:first-child {
.customize-support .wp-core-ui .hide-if-customize {
display: none;
}

View File

@ -73,7 +73,7 @@ foreach ( $menu as $id => $data ) {
$new_parent = $first_sub[2];
// If the first submenu is not the same as the assigned parent,
// make the first submenu the new parent.
if ( $new_parent != $old_parent && 'customize.php' != $new_parent ) {
if ( $new_parent != $old_parent ) {
$_wp_real_parent_file[$old_parent] = $new_parent;
$menu[$id][2] = $new_parent;

View File

@ -53,7 +53,7 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
$class[] = 'wp-has-submenu';
$submenu_items = $submenu[$item[2]];
}
if ( ( $parent_file && $item[2] == $parent_file ) || ( empty($typenow) && $self == $item[2] ) ) {
$class[] = ! empty( $submenu_items ) ? 'wp-has-current-submenu wp-menu-open' : 'current';
} else {
@ -82,9 +82,7 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
if ( false !== strpos( $class, 'wp-menu-separator' ) ) {
echo '<div class="separator"></div>';
} elseif ( $submenu_as_parent && ! empty( $submenu_items ) ) {
$temp_submenu_items = $submenu_items = array_values( $submenu_items ); // Re-index.
if ( 'customize.php' == $submenu_items[0][2] )
$submenu_items[0][2] = 'themes.php';
$submenu_items = array_values( $submenu_items ); // Re-index.
$menu_hook = get_plugin_page_hook( $submenu_items[0][2], $item[2] );
$menu_file = $submenu_items[0][2];
if ( false !== ( $pos = strpos( $menu_file, '?' ) ) )
@ -95,7 +93,6 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
} else {
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>";
}
$submenu_items = $temp_submenu_items;
} elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) {
$menu_hook = get_plugin_page_hook( $item[2], 'admin.php' );
$menu_file = $item[2];
@ -108,7 +105,7 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
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>";
}
}
if ( ! empty( $submenu_items ) ) {
echo "\n\t<ul class='wp-submenu wp-submenu-wrap'>";
echo "<li class='wp-submenu-head'>{$item[0]}</li>";
@ -143,9 +140,6 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
) {
$class[] = 'current';
}
if ( ! empty( $sub_item[3] ) )
$class[] = $sub_item[3];
$class = $class ? ' class="' . join( ' ', $class ) . '"' : '';

View File

@ -137,10 +137,10 @@ unset($ptype, $ptype_obj, $ptype_class, $ptype_for_id, $ptype_menu_position, $me
$menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' );
$appearance_cap = current_user_can( 'switch_themes') ? 'switch_themes' : 'edit_theme_options';
$menu[60] = array( __('Appearance'), $appearance_cap, 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' );
$submenu['themes.php'][4] = array( __( 'Customize' ), $appearance_cap, 'customize.php', 'hide-if-no-customize' );
$submenu['themes.php'][5] = array(__( 'Themes' ), $appearance_cap, 'themes.php');
$submenu['themes.php'][5] = array( __( 'Themes' ), $appearance_cap, 'themes.php' );
$submenu['themes.php'][6] = array( __( 'Customize' ), $appearance_cap, 'customize.php', 'hide-if-no-customize' );
if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
$submenu['themes.php'][10] = array(__( 'Menus' ), 'edit_theme_options', 'nav-menus.php');

View File

@ -159,14 +159,8 @@ $customize_title = sprintf( __( 'Customize &#8220;%s&#8221;' ), $ct->display('Na
if ( is_array( $submenu ) && isset( $submenu['themes.php'] ) ) {
foreach ( (array) $submenu['themes.php'] as $item) {
$class = '';
if ( 'themes.php' == $item[2] || 'theme-editor.php' == $item[2] )
if ( 'themes.php' == $item[2] || 'theme-editor.php' == $item[2] || 'customize.php' == $item[2] )
continue;
if ( 'customize.php' == $item[2] ) {
if ( current_user_can( 'edit_theme_options' ) )
$class = ' class="load-customize hide-if-no-customize"';
else
continue;
}
// 0 = name, 1 = capability, 2 = file
if ( ( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file)) )
$class = ' class="current"';
@ -193,7 +187,12 @@ $customize_title = sprintf( __( 'Customize &#8220;%s&#8221;' ), $ct->display('Na
if ( $options || current_user_can( 'edit_theme_options' ) ) :
?>
<div class="theme-options">
<?php if ( $options ) : ?>
<?php if ( current_user_can( 'edit_theme_options' ) ) : ?>
<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>
<?php
endif; // edit_theme_options
if ( $options ) :
?>
<span><?php _e( 'Options:' )?></span>
<ul>
<?php foreach ( $options as $option ) : ?>