From c3249b5f7f41a2e4746e073309b90f1d82989ac9 Mon Sep 17 00:00:00 2001 From: Daryl Koopersmith Date: Wed, 29 Feb 2012 22:43:12 +0000 Subject: [PATCH] Theme Customizer: Load the preview iframe with the same scheme as the admin to prevent security warnings. props ocean90. fixes #20137, see #19910. git-svn-id: https://develop.svn.wordpress.org/trunk@20051 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/customize-controls.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/customize-controls.php b/wp-includes/customize-controls.php index 94f6821789..c6d6a5106d 100644 --- a/wp-includes/customize-controls.php +++ b/wp-includes/customize-controls.php @@ -80,8 +80,10 @@ do_action( 'customize_controls_print_scripts' ); do_action( 'customize_controls_print_footer_scripts' ); + // Check current scheme and load the preview with the same scheme + $scheme = is_ssl() ? 'https' : 'http'; $settings = array( - 'preview' => esc_url( home_url( '/' ) ), + 'preview' => esc_url( get_home_url( null, '/', $scheme ) ), 'values' => array(), 'prefix' => WP_Customize_Setting::name_prefix, );