Make WordPress Core


Ignore:
Timestamp:
04/04/2012 09:02:29 PM (14 years ago)
Author:
koopersmith
Message:

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.
File:
1 edited

Legend:

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

    r20104 r20352  
    132132                home_url( '/' ) ) );
    133133
     134            $customize_attributes = 'title="' . esc_attr( sprintf( __( 'Customize “%s”' ), $title ) ) . '"
     135                . data-customize-template="' . esc_attr( $template ) . '" data-customize-stylesheet="' . esc_attr( $stylesheet ) . '"';
     136
    134137            $actions = array();
    135138            $actions[] = '<a href="' . $activate_link . '" class="activatelink" title="'
    136139                . esc_attr( sprintf( __( 'Activate &#8220;%s&#8221;' ), $title ) ) . '">' . __( 'Activate' ) . '</a>';
    137             $actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="'
    138                 . esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $title ) ) . '">' . __( 'Preview' ) . '</a>';
     140            $actions[] = '<a href="' . $preview_link . '" class="hide-if-js" title="'
     141                . esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $title ) ) . '">' . __( 'Preview' ) . '</a>'
     142                . '<a href="#" class="load-customize hide-if-no-js" ' . $customize_attributes . '>' . __( 'Customize' ) . '</a>';
    139143            if ( ! is_multisite() && current_user_can( 'delete_themes' ) )
    140144                $actions[] = '<a class="submitdelete deletion" href="' . wp_nonce_url( "themes.php?action=delete&amp;template=$stylesheet", 'delete-theme_' . $stylesheet )
     
    146150            $actions = implode ( ' | ', $actions );
    147151            ?>
    148             <a href="<?php echo $preview_link; ?>" class="thickbox thickbox-preview screenshot">
     152            <a href="<?php echo $preview_link; ?>" class="load-customize screenshot" <?php echo $customize_attributes; ?>>
    149153            <?php if ( $screenshot = $theme->get_screenshot() ) : ?>
    150154                <img src="<?php echo esc_url( $screenshot ); ?>" alt="" />
Note: See TracChangeset for help on using the changeset viewer.