WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/16/2012 02:02:28 PM (7 years ago)
Author:
koopersmith
Message:

Theme Customizer: Allow the customize iframe to be accessed directly (with full feature support). see #19910.

  • Move the 'Return to Manage Themes' and 'Collapse Sidebar' actions from themes.php to customize-controls.php.
  • Create a postMessage connection between themes.php and customize-controls.php.
  • Allow the theme customizer to be accessed directly (independent of themes.php and the customize loader).
  • Add wp_customize_href() and wp_customize_url().
  • Remove wp_customize_loader(). To include the loader, use wp_enqueue_script( 'customize-loader' ).
  • The theme customizer now requires postMessage browser support.
  • Add .hide-if-customize and .hide-if-no-customize CSS classes.
  • Clean up customize-preview.js.
File:
1 edited

Legend:

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

    r20455 r20476  
    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 
    137134            $actions = array();
    138135            $actions[] = '<a href="' . $activate_link . '" class="activatelink" title="'
    139136                . esc_attr( sprintf( __( 'Activate &#8220;%s&#8221;' ), $title ) ) . '">' . __( 'Activate' ) . '</a>';
    140             $actions[] = '<a href="' . $preview_link . '" class="hide-if-js" title="'
     137            $actions[] = '<a href="' . $preview_link . '" class="hide-if-customize" title="'
    141138                . esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $title ) ) . '">' . __( 'Preview' ) . '</a>'
    142                 . '<a href="#" class="load-customize hide-if-no-js" ' . $customize_attributes . '>' . __( 'Customize' ) . '</a>';
     139                . '<a ' . wp_customize_href( $template, $stylesheet ) . ' class="load-customize hide-if-no-customize">'
     140                . __( 'Customize' ) . '</a>';
    143141            if ( ! is_multisite() && current_user_can( 'delete_themes' ) )
    144142                $actions['delete'] = '<a class="submitdelete deletion" href="' . wp_nonce_url( "themes.php?action=delete&amp;template=$stylesheet", 'delete-theme_' . $stylesheet )
     
    151149
    152150            ?>
    153             <a href="<?php echo $preview_link; ?>" class="load-customize screenshot" <?php echo $customize_attributes; ?>>
    154             <?php if ( $screenshot = $theme->get_screenshot() ) : ?>
    155                 <img src="<?php echo esc_url( $screenshot ); ?>" alt="" />
    156             <?php endif; ?>
     151
     152            <a href="<?php echo $preview_link; ?>" class="screenshot hide-if-customize">
     153                <?php if ( $screenshot = $theme->get_screenshot() ) : ?>
     154                    <img src="<?php echo esc_url( $screenshot ); ?>" alt="" />
     155                <?php endif; ?>
    157156            </a>
     157            <a <?php echo wp_customize_href( $template, $stylesheet ); ?> class="screenshot load-customize hide-if-no-customize">
     158                <?php if ( $screenshot = $theme->get_screenshot() ) : ?>
     159                    <img src="<?php echo esc_url( $screenshot ); ?>" alt="" />
     160                <?php endif; ?>
     161            </a>
     162
    158163            <h3><?php echo $title; ?></h3>
    159164            <div class="theme-author"><?php printf( __( 'By %s' ), $author ); ?></div>
Note: See TracChangeset for help on using the changeset viewer.