From 379393651b1e60e8632f4e49cd41b78554fb5d40 Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Wed, 8 Apr 2015 18:58:08 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@32086 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-customize-control.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/class-wp-customize-control.php b/src/wp-includes/class-wp-customize-control.php index 9be8e75ae8..3f1455a824 100644 --- a/src/wp-includes/class-wp-customize-control.php +++ b/src/wp-includes/class-wp-customize-control.php @@ -1242,7 +1242,8 @@ class WP_Customize_Theme_Control extends WP_Customize_Control { * @access public */ public function content_template() { - $preview_url = site_url( add_query_arg( 'theme', '{{ data.theme.id }}' ) ); + $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); + $preview_url = add_query_arg( 'theme', '{{ data.theme.id }}', $current_url ); ?>
<# if ( data.theme.screenshot[0] ) { #>