Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add "Customize" as first item under Appearance menu.

fixes #21413. props ryanhellyer, obenland, DrewAPicture

git-svn-id: http://core.svn.wordpress.org/trunk@23871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
commit 8c4aeb918856b70ea54575333a620e2e84b90e39 1 parent e3b7b18
@markjaquith markjaquith authored
View
9 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;
}
View
11 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;
}
View
2  wp-admin/includes/menu.php
@@ -73,7 +73,7 @@
$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;
View
12 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 '<div class="separator"></div>';
} 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<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];
@@ -105,7 +108,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>";
@@ -140,6 +143,9 @@ 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
20 wp-admin/menu.php
@@ -136,17 +136,15 @@
$menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' );
-if ( current_user_can( 'switch_themes') ) {
- $menu[60] = array( __('Appearance'), 'switch_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'none' );
- $submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.php');
- if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
- $submenu['themes.php'][10] = array(__('Menus'), 'edit_theme_options', 'nav-menus.php');
-} else {
- $menu[60] = array( __('Appearance'), 'edit_theme_options', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'none' );
- $submenu['themes.php'][5] = array(__('Themes'), 'edit_theme_options', 'themes.php');
- if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
- $submenu['themes.php'][10] = array(__('Menus'), 'edit_theme_options', 'nav-menus.php' );
-}
+$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');
+ if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
+ $submenu['themes.php'][10] = array(__( 'Menus' ), 'edit_theme_options', 'nav-menus.php');
+
+unset( $appearance_cap );
// Add 'Editor' to the bottom of the Appearance menu.
if ( ! is_multisite() )
View
13 wp-admin/themes.php
@@ -161,6 +161,12 @@
$class = '';
if ( 'themes.php' == $item[2] || 'theme-editor.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"';
@@ -187,12 +193,7 @@
if ( $options || current_user_can( 'edit_theme_options' ) ) :
?>
<div class="theme-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 ) :
- ?>
+ <?php if ( $options ) : ?>
<span><?php _e( 'Options:' )?></span>
<ul>
<?php foreach ( $options as $option ) : ?>
Please sign in to comment.
Something went wrong with that request. Please try again.