WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/24/2015 08:30:22 PM (6 years ago)
Author:
markjaquith
Message:

Add theme browsing and theme switching to the Customizer

  • Brings into core the Customizer Theme Switcher feature plugin
  • You can now browse, preview, and activate themes right from the Customizer

fixes #31303.
props celloexpressions, afercia, westonruter, folletto, designsimply

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/customize.php

    r31484 r31533  
    137137        </div>
    138138
    139         <?php
    140             $screenshot = $wp_customize->theme()->get_screenshot();
    141             $cannot_expand = ! ( $wp_customize->is_theme_active() || $screenshot || $wp_customize->theme()->get('Description') );
    142         ?>
    143 
    144139        <div id="widgets-right"><!-- For Widget Customizer, many widgets try to look for instances under div#widgets-right, so we have to add that ID to a container div in the Customizer for compat -->
    145140        <div class="wp-full-overlay-sidebar-content" tabindex="-1">
    146             <div id="customize-info" class="accordion-section <?php if ( $cannot_expand ) echo ' cannot-expand'; ?>">
     141            <div id="customize-info" class="accordion-section">
    147142                <div class="accordion-section-title" aria-label="<?php esc_attr_e( 'Customizer Options' ); ?>" tabindex="0">
    148143                    <span class="preview-notice"><?php
    149                         if ( ! $wp_customize->is_theme_active() ) {
    150                             /* translators: %s is the theme name in the Customize/Live Preview pane */
    151                             echo sprintf( __( 'You are previewing %s' ), '<strong class="theme-name">' . $wp_customize->theme()->display('Name') . '</strong>' );
    152                         } else {
    153                             /* translators: %s is the site/panel title in the Customize pane */
    154                             echo sprintf( __( 'You are customizing %s' ), '<strong class="theme-name site-title">' . get_bloginfo( 'name' ) . '</strong>' );
    155                         }
     144                        echo sprintf( __( 'You are customizing %s' ), '<strong class="theme-name site-title">' . get_bloginfo( 'name' ) . '</strong>' );
    156145                    ?></span>
    157146                </div>
    158                 <?php if ( ! $cannot_expand ) : ?>
    159                 <div class="accordion-section-content">
    160                     <?php if ( ! $wp_customize->is_theme_active() ) :
    161                         if ( $screenshot ) : ?>
    162                             <img class="theme-screenshot" src="<?php echo esc_url( $screenshot ); ?>" />
    163                         <?php endif; ?>
    164 
    165                         <?php if ( $wp_customize->theme()->get('Description') ): ?>
    166                             <div class="theme-description"><?php echo $wp_customize->theme()->display('Description'); ?></div>
    167                         <?php endif;
    168                     else:
    169                         echo __( 'The Customizer allows you to preview changes to your site before publishing them. You can also navigate to different pages on your site to preview them.' );
    170                     endif; ?>
    171                 </div>
    172                 <?php endif; ?>
     147                <div class="accordion-section-content"><?php
     148                    echo __( 'The Customizer allows you to preview changes to your site before publishing them. You can also navigate to different pages on your site to preview them.' );
     149                ?></div>
    173150            </div>
    174151
     
    247224            'preview'       => esc_url_raw( $url ? $url : home_url( '/' ) ),
    248225            'parent'        => esc_url_raw( admin_url() ),
    249             'activated'     => esc_url_raw( admin_url( 'themes.php?activated=true&previewed' ) ),
     226            'activated'     => esc_url_raw( home_url( '/' ) ),
    250227            'ajax'          => esc_url_raw( admin_url( 'admin-ajax.php', 'relative' ) ),
    251228            'allowed'       => array_map( 'esc_url_raw', $allowed_urls ),
Note: See TracChangeset for help on using the changeset viewer.