Make WordPress Core


Ignore:
Timestamp:
07/29/2015 06:35:40 PM (11 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-upgrader-skins.php

    r32974 r33492  
    651651                $template   = $theme_info->get_template();
    652652
    653                 $preview_link = add_query_arg( array(
    654                         'preview'    => 1,
    655                         'template'   => urlencode( $template ),
    656                         'stylesheet' => urlencode( $stylesheet ),
    657                 ), trailingslashit( home_url() ) );
    658 
    659653                $activate_link = add_query_arg( array(
    660654                        'action'     => 'activate',
    … …  
    665659
    666660                $install_actions = array();
    667                 $install_actions['preview']  = '<a href="' . esc_url( $preview_link ) . '" class="hide-if-customize"><span aria-hidden="true">' . __( 'Preview' ) . '</span><span class="screen-reader-text">' . sprintf( __( 'Preview &#8220;%s&#8221;' ), $name ) . '</span></a>';
     661
    668662                if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
    669663                        $install_actions['preview'] .= '<a href="' . wp_customize_url( $stylesheet ) . '" class="hide-if-no-customize load-customize"><span aria-hidden="true">' . __( 'Live Preview' ) . '</span><span class="screen-reader-text">' . sprintf( __( 'Live Preview &#8220;%s&#8221;' ), $name ) . '</span></a>';
    … …  
    733727                        $template   = $theme_info->get_template();
    734728
    735                         $preview_link = add_query_arg( array(
    736                                 'preview'    => 1,
    737                                 'template'   => urlencode( $template ),
    738                                 'stylesheet' => urlencode( $stylesheet ),
    739                         ), trailingslashit( home_url() ) );
    740 
    741729                        $activate_link = add_query_arg( array(
    742730                                'action'     => 'activate',
    … …  
    751739                                }
    752740                        } elseif ( current_user_can( 'switch_themes' ) ) {
    753                                 $update_actions['preview']  = '<a href="' . esc_url( $preview_link ) . '" class="hide-if-customize"><span aria-hidden="true">' . __( 'Preview' ) . '</span><span class="screen-reader-text">' . sprintf( __( 'Preview &#8220;%s&#8221;' ), $name ) . '</span></a>';
    754741                                if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
    755742                                        $update_actions['preview'] .= '<a href="' . wp_customize_url( $stylesheet ) . '" class="hide-if-no-customize load-customize"><span aria-hidden="true">' . __( 'Live Preview' ) . '</span><span class="screen-reader-text">' . sprintf( __( 'Live Preview &#8220;%s&#8221;' ), $name ) . '</span></a>';
Note: See TracChangeset for help on using the changeset viewer.