WordPress.org

Make WordPress Core

Changeset 32086


Ignore:
Timestamp:
04/08/2015 06:58:08 PM (4 years ago)
Author:
ocean90
Message:

Customizer Theme Switcher: Fix preview URL for subfolder installs.

Use $_SERVER['HTTP_HOST'] and $_SERVER['REQUEST_URI'] instead of site_url() and $_SERVER['REQUEST_URI'].

fixes #31896.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-control.php

    r32028 r32086  
    12431243     */
    12441244    public function content_template() {
    1245         $preview_url = site_url( add_query_arg( 'theme', '{{ data.theme.id }}' ) );
     1245        $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
     1246        $preview_url = add_query_arg( 'theme', '{{ data.theme.id }}', $current_url );
    12461247        ?>
    12471248        <div class="theme" tabindex="0" data-preview-url="<?php echo esc_attr( $preview_url ); ?>" aria-describedby="{{ data.theme.id }}-action {{ data.theme.id }}-name">
Note: See TracChangeset for help on using the changeset viewer.