mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-15 14:20:24 +00:00
Theme Customizer: Improve the customize loader and themes list table markup. see #19910.
* Use event delegation for triggering the customize loader (so we play nicely with infinite scroll). * Use data attributes on .load-customize links instead of parsing the href. * Properly translate the 'Customize' string instead of injecting the replacement with JS. git-svn-id: https://develop.svn.wordpress.org/trunk@20352 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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[] = '<a href="' . $activate_link . '" class="activatelink" title="'
|
||||
. esc_attr( sprintf( __( 'Activate “%s”' ), $title ) ) . '">' . __( 'Activate' ) . '</a>';
|
||||
$actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="'
|
||||
. esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '">' . __( 'Preview' ) . '</a>';
|
||||
$actions[] = '<a href="' . $preview_link . '" class="hide-if-js" title="'
|
||||
. esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '">' . __( 'Preview' ) . '</a>'
|
||||
. '<a href="#" class="load-customize hide-if-no-js" ' . $customize_attributes . '>' . __( 'Customize' ) . '</a>';
|
||||
if ( ! is_multisite() && current_user_can( 'delete_themes' ) )
|
||||
$actions[] = '<a class="submitdelete deletion" href="' . wp_nonce_url( "themes.php?action=delete&template=$stylesheet", 'delete-theme_' . $stylesheet )
|
||||
. '" onclick="' . "return confirm( '" . esc_js( sprintf( __( "You are about to delete this theme '%s'\n 'Cancel' to stop, 'OK' to delete." ), $title ) )
|
||||
@@ -145,7 +149,7 @@ class WP_Themes_List_Table extends WP_List_Table {
|
||||
|
||||
$actions = implode ( ' | ', $actions );
|
||||
?>
|
||||
<a href="<?php echo $preview_link; ?>" class="thickbox thickbox-preview screenshot">
|
||||
<a href="<?php echo $preview_link; ?>" class="load-customize screenshot" <?php echo $customize_attributes; ?>>
|
||||
<?php if ( $screenshot = $theme->get_screenshot() ) : ?>
|
||||
<img src="<?php echo esc_url( $screenshot ); ?>" alt="" />
|
||||
<?php endif; ?>
|
||||
|
||||
Reference in New Issue
Block a user