WordPress.org

Make WordPress Core

Changeset 20934


Ignore:
Timestamp:
05/26/2012 03:32:05 PM (7 years ago)
Author:
nacin
Message:

Theme Customizer: As customize.php without a theme parameter defaults to the current theme, update wp_customize_url() to make $stylesheet optional and update references for the current theme.

see #19910, #20751, #20575.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/themes.php

    r20810 r20934  
    121121<div id="current-theme" class="<?php echo esc_attr( $class ); ?>">
    122122    <?php if ( $screenshot ) : ?>
    123         <a href="<?php echo wp_customize_url( $ct->get_stylesheet() ); ?>" class="load-customize hide-if-no-customize" title="<?php echo esc_attr( $customize_title ); ?>">
     123        <a href="<?php echo wp_customize_url(); ?>" class="load-customize hide-if-no-customize" title="<?php echo esc_attr( $customize_title ); ?>">
    124124            <img src="<?php echo esc_url( $screenshot ); ?>" alt="<?php esc_attr_e( 'Current theme preview' ); ?>" />
    125125        </a>
     
    142142
    143143<div class="theme-options">
    144     <a id="customize-current-theme-link" href="<?php echo wp_customize_url( $ct->get_stylesheet() ); ?>" class="load-customize hide-if-no-customize" title="<?php echo esc_attr( $customize_title ); ?>"><?php _e( 'Customize' )?></a>
     144    <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>
    145145    <span><?php _e( 'Options:' )?></span>
    146146    <?php
  • trunk/wp-includes/admin-bar.php

    r20918 r20934  
    581581        'id'     => 'customize',
    582582        'title'  => __('Customize'),
    583         'href'   => wp_customize_url(get_stylesheet()),
     583        'href'   => wp_customize_url(),
    584584        'meta'   => array(
    585585            'class' => 'hide-if-no-customize',
  • trunk/wp-includes/theme.php

    r20918 r20934  
    16161616 *
    16171617 * @since 3.4.0
    1618  */
    1619 function wp_customize_url( $stylesheet ) {
    1620     return esc_url( admin_url( 'customize.php' ) . '?theme=' . $stylesheet );
     1618 *
     1619 * @param string $stylesheet Optional. Theme to customize. Defaults to current theme.
     1620 */
     1621function wp_customize_url( $stylesheet = null ) {
     1622    $url = admin_url( 'customize.php' );
     1623    if ( $stylesheet )
     1624        $url .= '?theme=' . $stylesheet;
     1625    return esc_url( $url );
    16211626}
    16221627
Note: See TracChangeset for help on using the changeset viewer.