From cba9bc1cfb7964e4dc27f11f886cd4250cc1de4d Mon Sep 17 00:00:00 2001 From: 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: http://svn.automattic.com/wordpress/trunk@20051 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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, );