diff --git a/wp-admin/includes/class-wp-themes-list-table.php b/wp-admin/includes/class-wp-themes-list-table.php
index 5cecb6b04..b2b16cd92 100644
--- a/wp-admin/includes/class-wp-themes-list-table.php
+++ b/wp-admin/includes/class-wp-themes-list-table.php
@@ -131,11 +131,15 @@ class WP_Themes_List_Table extends WP_List_Table {
array( 'preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => true, 'TB_iframe' => 'true' ),
home_url( '/' ) ) );
+ $customize_attributes = 'title="' . esc_attr( sprintf( __( 'Customize “%s”' ), $title ) ) . '"
+ . data-customize-template="' . esc_attr( $template ) . '" data-customize-stylesheet="' . esc_attr( $stylesheet ) . '"';
+
$actions = array();
$actions[] = '' . __( 'Activate' ) . '';
- $actions[] = '' . __( 'Preview' ) . '';
+ $actions[] = '' . __( 'Preview' ) . ''
+ . '' . __( 'Customize' ) . '';
if ( ! is_multisite() && current_user_can( 'delete_themes' ) )
$actions[] = '
-
+ >
get_screenshot() ) : ?>
diff --git a/wp-includes/js/customize-loader.dev.js b/wp-includes/js/customize-loader.dev.js
index fb83840f9..32fbeb77d 100644
--- a/wp-includes/js/customize-loader.dev.js
+++ b/wp-includes/js/customize-loader.dev.js
@@ -41,27 +41,17 @@ if ( typeof wp === 'undefined' )
$( function() {
Loader.initialize();
- // Override 'preview' links on themes page.
- $('.thickbox-preview').click( function( event ) {
- var href, template, stylesheet;
+ $('#current-theme, #availablethemes').on( 'click', '.load-customize', function( event ) {
+ var load = $(this);
- // Stop the thickbox.
event.preventDefault();
- event.stopImmediatePropagation();
-
- // Extract the template/stylesheet from the preview link's url.
- href = $(this).attr('href');
- template = href.match('template=([^&]*)')[1];
- stylesheet = href.match('stylesheet=([^&]*)')[1];
// Load the theme.
Loader.open({
- template: template,
- stylesheet: stylesheet
+ template: load.data('customizeTemplate'),
+ stylesheet: load.data('customizeStylesheet')
});
- }).filter( function() {
- return 'Preview' == $(this).text();
- }).text('Customize');
+ });
});
// Expose the API to the world.