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:
parent
e07ced46ab
commit
f6882e94ef
|
@ -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
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue