Theme Customizer: Add a base element to the preview's head element to allow relative links (root, hash, and query strings). see #20507, #19910.

git-svn-id: http://core.svn.wordpress.org/trunk@20863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
koopersmith 2012-05-24 02:07:16 +00:00
parent e07ced46ab
commit f6882e94ef
1 changed files with 10 additions and 1 deletions

View File

@ -254,6 +254,7 @@ final class WP_Customize_Manager {
$this->prepare_controls(); $this->prepare_controls();
wp_enqueue_script( 'customize-preview' ); wp_enqueue_script( 'customize-preview' );
add_action( 'wp_head', array( $this, 'customize_preview_base' ) );
add_action( 'wp_footer', array( $this, 'customize_preview_settings' ), 20 ); add_action( 'wp_footer', array( $this, 'customize_preview_settings' ), 20 );
foreach ( $this->settings as $setting ) { foreach ( $this->settings as $setting ) {
@ -263,9 +264,17 @@ final class WP_Customize_Manager {
do_action( 'customize_preview_init', $this ); do_action( 'customize_preview_init', $this );
} }
/**
* Print base element for preview frame.
*
* @since 3.4.0
*/
public function customize_preview_base() {
?><base href="<?php echo home_url( '/' ); ?>" /><?php
}
/** /**
* Print javascript settings. * Print javascript settings for preview frame.
* *
* @since 3.4.0 * @since 3.4.0
*/ */