WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/29/2015 06:35:40 PM (5 years ago)
Author:
ocean90
Message:

Themes: Remove legacy theme preview.

The pre-3.4 theme previewer doesn't work when using a static front page.
We kept the old theme preview for no-JS and some browsers that were less capable. But since browsers are doing a better job today we don't need to continue fixing/shipping this legacy code. Bye!

fixes #33178.

File:
1 edited

Legend:

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

    r32656 r33492  
    175175            $activate_link = wp_nonce_url( "themes.php?action=activate&template=" . urlencode( $template ) . "&stylesheet=" . urlencode( $stylesheet ), 'switch-theme_' . $stylesheet );
    176176
    177             $preview_link = esc_url( add_query_arg(
    178                 array( 'preview' => 1, 'template' => urlencode( $template ), 'stylesheet' => urlencode( $stylesheet ), 'preview_iframe' => true, 'TB_iframe' => 'true' ),
    179                 home_url( '/' ) ) );
    180 
    181177            $actions = array();
    182178            $actions['activate'] = '<a href="' . $activate_link . '" class="activatelink" title="'
    183179                . esc_attr( sprintf( __( 'Activate &#8220;%s&#8221;' ), $title ) ) . '">' . __( 'Activate' ) . '</a>';
    184 
    185             $actions['preview'] = '<a href="' . $preview_link . '" class="hide-if-customize" title="'
    186                 . esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $title ) ) . '">' . __( 'Preview' ) . '</a>';
    187180
    188181            if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
     
    206199            ?>
    207200
    208             <a href="<?php echo $preview_link; ?>" class="screenshot hide-if-customize">
     201            <span class="screenshot hide-if-customize">
    209202                <?php if ( $screenshot = $theme->get_screenshot() ) : ?>
    210203                    <img src="<?php echo esc_url( $screenshot ); ?>" alt="" />
    211204                <?php endif; ?>
    212             </a>
     205            </span>
    213206            <a href="<?php echo wp_customize_url( $stylesheet ); ?>" class="screenshot load-customize hide-if-no-customize">
    214207                <?php if ( $screenshot = $theme->get_screenshot() ) : ?>
Note: See TracChangeset for help on using the changeset viewer.