Make WordPress Core

Changeset 24048


Ignore:
Timestamp:
04/22/2013 07:33:39 PM (9 years ago)
Author:
nacin
Message:

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

Location:
trunk/wp-admin
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/wp-admin-rtl.css

    r24006 r24048  
    13181318}
    13191319
     1320.theme-options .load-customize {
     1321    margin-right: 0;
     1322    margin-left: 30px;
     1323    float: right;
     1324}
     1325
    13201326.theme-options span {
    13211327    float: right;
     
    13241330}
    13251331
    1326 .theme-options ul,
    1327 .theme-options .load-customize {
     1332.theme-options ul {
    13281333    float: right;
    13291334}
  • trunk/wp-admin/css/wp-admin.css

    r24043 r24048  
    55165516}
    55175517
     5518.theme-options .load-customize {
     5519    margin-right: 30px;
     5520    float: left;
     5521}
     5522
    55185523.theme-options span {
    55195524    float: left;
     
    55255530}
    55265531
    5527 .theme-options ul,
    5528 .theme-options .load-customize {
     5532.theme-options ul {
    55295533    float: left;
    55305534    margin: 0;
     
    64566460.no-customize-support .wp-core-ui .hide-if-no-customize,
    64576461.customize-support.wp-core-ui .hide-if-customize,
    6458 .customize-support .wp-core-ui .hide-if-customize,
    6459 .no-customize-support .theme-options ul li:first-child {
     6462.customize-support .wp-core-ui .hide-if-customize {
    64606463    display: none;
    64616464}
  • trunk/wp-admin/includes/menu.php

    r23871 r24048  
    7474    // If the first submenu is not the same as the assigned parent,
    7575    // make the first submenu the new parent.
    76     if ( $new_parent != $old_parent && 'customize.php' != $new_parent ) {
     76    if ( $new_parent != $old_parent ) {
    7777        $_wp_real_parent_file[$old_parent] = $new_parent;
    7878        $menu[$id][2] = $new_parent;
  • trunk/wp-admin/menu-header.php

    r23871 r24048  
    5454            $submenu_items = $submenu[$item[2]];
    5555        }
    56        
     56
    5757        if ( ( $parent_file && $item[2] == $parent_file ) || ( empty($typenow) && $self == $item[2] ) ) {
    5858            $class[] = ! empty( $submenu_items ) ? 'wp-has-current-submenu wp-menu-open' : 'current';
     
    8383            echo '<div class="separator"></div>';
    8484        } elseif ( $submenu_as_parent && ! empty( $submenu_items ) ) {
    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';
     85            $submenu_items = array_values( $submenu_items );  // Re-index.
    8886            $menu_hook = get_plugin_page_hook( $submenu_items[0][2], $item[2] );
    8987            $menu_file = $submenu_items[0][2];
     
    9694                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>";
    9795            }
    98             $submenu_items = $temp_submenu_items;
    9996        } elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) {
    10097            $menu_hook = get_plugin_page_hook( $item[2], 'admin.php' );
     
    109106            }
    110107        }
    111        
     108
    112109        if ( ! empty( $submenu_items ) ) {
    113110            echo "\n\t<ul class='wp-submenu wp-submenu-wrap'>";
     
    144141                    $class[] = 'current';
    145142                }
    146                
    147                 if ( ! empty( $sub_item[3] ) )
    148                     $class[] = $sub_item[3];
    149143
    150144                $class = $class ? ' class="' . join( ' ', $class ) . '"' : '';
  • trunk/wp-admin/menu.php

    r23871 r24048  
    138138
    139139$appearance_cap = current_user_can( 'switch_themes') ? 'switch_themes' : 'edit_theme_options';
    140  
     140
    141141$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');
     142    $submenu['themes.php'][5] = array( __( 'Themes' ), $appearance_cap, 'themes.php' );
     143    $submenu['themes.php'][6] = array( __( 'Customize' ), $appearance_cap, 'customize.php', 'hide-if-no-customize' );
    144144    if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
    145145        $submenu['themes.php'][10] = array(__( 'Menus' ), 'edit_theme_options', 'nav-menus.php');
  • trunk/wp-admin/themes.php

    r23871 r24048  
    160160        foreach ( (array) $submenu['themes.php'] as $item) {
    161161            $class = '';
    162             if ( 'themes.php' == $item[2] || 'theme-editor.php' == $item[2] )
     162            if ( 'themes.php' == $item[2] || 'theme-editor.php' == $item[2] || 'customize.php' == $item[2] )
    163163                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             }
    170164            // 0 = name, 1 = capability, 2 = file
    171165            if ( ( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file)) )
     
    194188    ?>
    195189    <div class="theme-options">
    196         <?php if ( $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        ?>
    197196        <span><?php _e( 'Options:' )?></span>
    198197        <ul>
Note: See TracChangeset for help on using the changeset viewer.