Make WordPress Core


Ignore:
Timestamp:
04/10/2012 02:25:03 AM (14 years ago)
Author:
koopersmith
Message:

Replace all instances of thickbox theme preview with the theme customizer. fixes #20404.

  • Use theme customizer in theme install/update screens.
  • Separate the customize loader from the customizer. Use wp_customize_loader() to include the loader script and markup.
  • Deprecated: wp-admin/js/theme-preview.js is now no longer used by core.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/theme.php

    r20375 r20419  
    15641564}
    15651565
    1566 function wp_customize_load() {
     1566/**
     1567 * Includes and instantiates the WP_Customize class.
     1568 *
     1569 * Fires when ?customize=on.
     1570 *
     1571 * @since 3.4.0
     1572 */
     1573function _wp_customize_include() {
    15671574    // Load on themes.php or ?customize=on
    1568     if ( ! ( isset( $_REQUEST['customize'] ) && 'on' == $_REQUEST['customize'] ) && 'themes.php' != $GLOBALS['pagenow'] )
     1575    if ( ! ( isset( $_REQUEST['customize'] ) && 'on' == $_REQUEST['customize'] ) )
    15691576        return;
    15701577
     
    15741581    $GLOBALS['customize'] = new WP_Customize;
    15751582}
    1576 add_action( 'plugins_loaded', 'wp_customize_load' );
     1583add_action( 'plugins_loaded', '_wp_customize_include' );
     1584
     1585/**
     1586 * Includes the loading scripts for the theme customizer and
     1587 * adds the action to print the customize container template.
     1588 *
     1589 * @since 3.4.0
     1590 */
     1591function wp_customize_loader() {
     1592    wp_enqueue_script( 'customize-loader' );
     1593    add_action( 'admin_footer', '_wp_customize_loader_template' );
     1594}
     1595
     1596/**
     1597 * Print the customize container template.
     1598 *
     1599 * @since 3.4.0
     1600 */
     1601function _wp_customize_loader_template() {
     1602    ?>
     1603    <div id="customize-container" class="wp-full-overlay">
     1604        <input type="hidden" class="admin-url" value="<?php echo esc_url( admin_url( 'admin.php' ) ); ?>" />
     1605        <a href="#" class="close-full-overlay"><?php printf( __( '&larr; Return to %s' ), get_admin_page_title() ); ?></a>
     1606        <a href="#" class="collapse-sidebar button-secondary" title="<?php esc_attr_e('Collapse Sidebar'); ?>">
     1607            <span class="collapse-sidebar-label"><?php _e('Collapse'); ?></span>
     1608            <span class="collapse-sidebar-arrow"></span>
     1609        </a>
     1610    </div>
     1611    <?php
     1612}
Note: See TracChangeset for help on using the changeset viewer.