From c51895c997daa4d5e01b77f9ac40c5c1f76da4bc Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Fri, 29 Mar 2013 20:39:54 +0000 Subject: [PATCH] Add "Customize" as first item under Appearance menu. fixes #21413. props ryanhellyer, obenland, DrewAPicture git-svn-id: https://develop.svn.wordpress.org/trunk@23871 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/css/wp-admin-rtl.css | 9 ++------- wp-admin/css/wp-admin.css | 11 ++++------- wp-admin/includes/menu.php | 2 +- wp-admin/menu-header.php | 12 +++++++++--- wp-admin/menu.php | 20 +++++++++----------- wp-admin/themes.php | 13 +++++++------ 6 files changed, 32 insertions(+), 35 deletions(-) diff --git a/wp-admin/css/wp-admin-rtl.css b/wp-admin/css/wp-admin-rtl.css index e04fafd8cf..7c4f91471d 100644 --- a/wp-admin/css/wp-admin-rtl.css +++ b/wp-admin/css/wp-admin-rtl.css @@ -1338,19 +1338,14 @@ 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 ul, +.theme-options .load-customize { float: right; } diff --git a/wp-admin/css/wp-admin.css b/wp-admin/css/wp-admin.css index 4fc6ef18cd..45b8b11b10 100644 --- a/wp-admin/css/wp-admin.css +++ b/wp-admin/css/wp-admin.css @@ -5547,11 +5547,6 @@ h3.available-themes { padding-bottom: 10px; } -.theme-options .load-customize { - margin-right: 30px; - float: left; -} - .theme-options span { float: left; margin-right: 10px; @@ -5561,7 +5556,8 @@ h3.available-themes { color: #999; } -.theme-options ul { +.theme-options ul, +.theme-options .load-customize { float: left; margin: 0; } @@ -6491,7 +6487,8 @@ 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 { +.customize-support .wp-core-ui .hide-if-customize, +.no-customize-support .theme-options ul li:first-child { display: none; } diff --git a/wp-admin/includes/menu.php b/wp-admin/includes/menu.php index 14cadfa6f7..9517ae9334 100644 --- a/wp-admin/includes/menu.php +++ b/wp-admin/includes/menu.php @@ -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 ) { + if ( $new_parent != $old_parent && 'customize.php' != $new_parent ) { $_wp_real_parent_file[$old_parent] = $new_parent; $menu[$id][2] = $new_parent; diff --git a/wp-admin/menu-header.php b/wp-admin/menu-header.php index c158cc2037..3e20c5f410 100644 --- a/wp-admin/menu-header.php +++ b/wp-admin/menu-header.php @@ -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,7 +82,9 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) { if ( false !== strpos( $class, 'wp-menu-separator' ) ) { echo '
'; } elseif ( $submenu_as_parent && ! empty( $submenu_items ) ) { - $submenu_items = array_values( $submenu_items ); // Re-index. + $temp_submenu_items = $submenu_items = array_values( $submenu_items ); // Re-index. + if ( 'customize.php' == $submenu_items[0][2] ) + $submenu_items[0][2] = 'themes.php'; $menu_hook = get_plugin_page_hook( $submenu_items[0][2], $item[2] ); $menu_file = $submenu_items[0][2]; if ( false !== ( $pos = strpos( $menu_file, '?' ) ) ) @@ -93,6 +95,7 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) { } else { echo "\n\t$arrow"; } + $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]; @@ -105,7 +108,7 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) { echo "\n\t$arrow"; } } - + if ( ! empty( $submenu_items ) ) { echo "\n\t