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.



git-svn-id: http://svn.automattic.com/wordpress/trunk@20477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2012-04-16 14:36:47 +00:00
parent a5dacf7da5
commit aab399efbc
4 changed files with 7 additions and 18 deletions

View File

@ -136,7 +136,7 @@ class WP_Themes_List_Table extends WP_List_Table {
. esc_attr( sprintf( __( 'Activate &#8220;%s&#8221;' ), $title ) ) . '">' . __( 'Activate' ) . '</a>';
$actions[] = '<a href="' . $preview_link . '" class="hide-if-customize" title="'
. esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $title ) ) . '">' . __( 'Preview' ) . '</a>'
. '<a ' . wp_customize_href( $template, $stylesheet ) . ' class="load-customize hide-if-no-customize">'
. '<a href="' . wp_customize_url( $stylesheet, $template ) . '" class="load-customize hide-if-no-customize">'
. __( 'Customize' ) . '</a>';
if ( ! is_multisite() && current_user_can( 'delete_themes' ) )
$actions['delete'] = '<a class="submitdelete deletion" href="' . wp_nonce_url( "themes.php?action=delete&amp;template=$stylesheet", 'delete-theme_' . $stylesheet )
@ -154,7 +154,7 @@ class WP_Themes_List_Table extends WP_List_Table {
<img src="<?php echo esc_url( $screenshot ); ?>" alt="" />
<?php endif; ?>
</a>
<a <?php echo wp_customize_href( $template, $stylesheet ); ?> class="screenshot load-customize hide-if-no-customize">
<a href="<?php echo wp_customize_url( $stylesheet, $template ); ?>" class="screenshot load-customize hide-if-no-customize">
<?php if ( $screenshot = $theme->get_screenshot() ) : ?>
<img src="<?php echo esc_url( $screenshot ); ?>" alt="" />
<?php endif; ?>

View File

@ -1516,7 +1516,7 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
$install_actions = array();
$install_actions['preview'] = '<a href="' . esc_url( $preview_link ) . '" class="hide-if-customize" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $name ) ) . '">' . __('Preview') . '</a>';
$install_actions['preview'] .= '<a ' . wp_customize_href( $template, $stylesheet ) . ' class="hide-if-no-customize load-customize>' . __('Customize') . '</a>';
$install_actions['preview'] .= '<a href="' . wp_customize_url( $stylesheet, $template ) . '" class="hide-if-no-customize load-customize>' . __('Customize') . '</a>';
$install_actions['activate'] = '<a href="' . esc_url( $activate_link ) . '" class="activatelink" title="' . esc_attr( sprintf( __('Activate &#8220;%s&#8221;'), $name ) ) . '">' . __('Activate') . '</a>';
if ( is_network_admin() && current_user_can( 'manage_network_themes' ) )
@ -1579,7 +1579,7 @@ class Theme_Upgrader_Skin extends WP_Upgrader_Skin {
$activate_link = wp_nonce_url( $activate_link, 'switch-theme_' . $template );
$update_actions['preview'] = '<a href="' . esc_url( $preview_link ) . '" class="hide-if-customize" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $name ) ) . '">' . __('Preview') . '</a>';
$update_actions['preview'] .= '<a ' . wp_customize_href( $template, $stylesheet ) . ' class="hide-if-no-customize load-customize">' . __('Customize') . '</a>';
$update_actions['preview'] .= '<a href="' . wp_customize_url( $stylesheet, $template ) . '" class="hide-if-no-customize load-customize">' . __('Customize') . '</a>';
$update_actions['activate'] = '<a href="' . esc_url( $activate_link ) . '" class="activatelink" title="' . esc_attr( sprintf( __('Activate &#8220;%s&#8221;'), $name ) ) . '">' . __('Activate') . '</a>';
if ( ( ! $this->result || is_wp_error( $this->result ) ) || $stylesheet == get_stylesheet() )

View File

@ -122,7 +122,7 @@ $class = $screenshot ? 'has-screenshot' : '';
</div>
<div class="theme-options">
<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>
<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>
<span><?php _e( 'Options:' )?></span>
<?php
// Pretend you didn't see this.

View File

@ -1599,17 +1599,6 @@ add_action( 'admin_enqueue_scripts', '_wp_customize_loader_localize' );
*
* @since 3.4.0
*/
function wp_customize_url( $template, $stylesheet = null ) {
$stylesheet = isset( $stylesheet ) ? $stylesheet : $template;
return admin_url( 'admin.php' ) . '?customize=on&template=' . $template . '&stylesheet=' . $stylesheet;
}
/**
* Prints an href attribute to load the theme customizer.
*
* @since 3.4.0
*/
function wp_customize_href( $template, $stylesheet = null ) {
$link = wp_customize_url( $template, $stylesheet );
return 'href="' . esc_url( $link ) . '"';
function wp_customize_url( $stylesheet, $template ) {
return esc_url( admin_url( 'admin.php' ) . '?customize=on&template=' . $template . '&stylesheet=' . $stylesheet );
}