WordPress.org

Make WordPress Core

Changeset 20477


Ignore:
Timestamp:
04/16/2012 02:36:47 PM (6 years ago)
Author:
nacin
Message:

Theme Customizer: Stick to wp_customize_url() instead of wp_customize_href(). Switch argument order so it is stylesheet-template. (Template is hypothetically optional, but the function will not support that.) see #19910.

Move to ->display('Name'), as ->get('Name') is a raw, untranslated version of the header.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-themes-list-table.php

    r20476 r20477  
    137137            $actions[] = '<a href="' . $preview_link . '" class="hide-if-customize" title="'
    138138                . esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $title ) ) . '">' . __( 'Preview' ) . '</a>'
    139                 . '<a ' . wp_customize_href( $template, $stylesheet ) . ' class="load-customize hide-if-no-customize">'
     139                . '<a href="' . wp_customize_url( $stylesheet, $template ) . '" class="load-customize hide-if-no-customize">'
    140140                . __( 'Customize' ) . '</a>';
    141141            if ( ! is_multisite() && current_user_can( 'delete_themes' ) )
     
    155155                <?php endif; ?>
    156156            </a>
    157             <a <?php echo wp_customize_href( $template, $stylesheet ); ?> class="screenshot load-customize hide-if-no-customize">
     157            <a href="<?php echo wp_customize_url( $stylesheet, $template ); ?>" class="screenshot load-customize hide-if-no-customize">
    158158                <?php if ( $screenshot = $theme->get_screenshot() ) : ?>
    159159                    <img src="<?php echo esc_url( $screenshot ); ?>" alt="" />
  • trunk/wp-admin/includes/class-wp-upgrader.php

    r20476 r20477  
    15171517        $install_actions = array();
    15181518        $install_actions['preview']  = '<a href="' . esc_url( $preview_link ) . '" class="hide-if-customize" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $name ) ) . '">' . __('Preview') . '</a>';
    1519         $install_actions['preview'] .= '<a ' . wp_customize_href( $template, $stylesheet ) . ' class="hide-if-no-customize load-customize>' . __('Customize') . '</a>';
     1519        $install_actions['preview'] .= '<a href="' . wp_customize_url( $stylesheet, $template ) . '" class="hide-if-no-customize load-customize>' . __('Customize') . '</a>';
    15201520        $install_actions['activate'] = '<a href="' . esc_url( $activate_link ) . '" class="activatelink" title="' . esc_attr( sprintf( __('Activate &#8220;%s&#8221;'), $name ) ) . '">' . __('Activate') . '</a>';
    15211521
     
    15801580
    15811581            $update_actions['preview']  = '<a href="' . esc_url( $preview_link ) . '" class="hide-if-customize" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $name ) ) . '">' . __('Preview') . '</a>';
    1582             $update_actions['preview'] .= '<a ' . wp_customize_href( $template, $stylesheet ) . ' class="hide-if-no-customize load-customize">' . __('Customize') . '</a>';
     1582            $update_actions['preview'] .= '<a href="' . wp_customize_url( $stylesheet, $template ) . '" class="hide-if-no-customize load-customize">' . __('Customize') . '</a>';
    15831583            $update_actions['activate'] = '<a href="' . esc_url( $activate_link ) . '" class="activatelink" title="' . esc_attr( sprintf( __('Activate &#8220;%s&#8221;'), $name ) ) . '">' . __('Activate') . '</a>';
    15841584
  • trunk/wp-admin/themes.php

    r20476 r20477  
    123123
    124124<div class="theme-options">
    125     <a <?php echo wp_customize_href( $ct->get_template(), $ct->get_stylesheet() ); ?> class="load-customize hide-if-no-customize" title="<?php echo esc_attr( sprintf( __( 'Customize &#8220;%s&#8221;' ), $ct->get('Name') ) ); ?>"><?php _e( 'Customize' )?></a>
     125    <a href="<?php echo wp_customize_url( $ct->get_stylesheet(), $ct->get_template() ); ?>" class="load-customize hide-if-no-customize" title="<?php echo esc_attr( sprintf( __( 'Customize &#8220;%s&#8221;' ), $ct->display('Name') ) ); ?>"><?php _e( 'Customize' )?></a>
    126126    <span><?php _e( 'Options:' )?></span>
    127127    <?php
  • trunk/wp-includes/theme.php

    r20476 r20477  
    16001600 * @since 3.4.0
    16011601 */
    1602 function wp_customize_url( $template, $stylesheet = null ) {
    1603     $stylesheet = isset( $stylesheet ) ? $stylesheet : $template;
    1604     return admin_url( 'admin.php' ) . '?customize=on&template=' . $template . '&stylesheet=' . $stylesheet;
    1605 }
    1606 
    1607 /**
    1608  * Prints an href attribute to load the theme customizer.
    1609  *
    1610  * @since 3.4.0
    1611  */
    1612 function wp_customize_href( $template, $stylesheet = null ) {
    1613     $link = wp_customize_url( $template, $stylesheet );
    1614     return 'href="' . esc_url( $link ) . '"';
    1615 }
     1602function wp_customize_url( $stylesheet, $template ) {
     1603    return esc_url( admin_url( 'admin.php' ) . '?customize=on&template=' . $template . '&stylesheet=' . $stylesheet );
     1604}
Note: See TracChangeset for help on using the changeset viewer.