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: https://develop.svn.wordpress.org/trunk@20863 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
9ec9ad920a
commit
1ec203203c
@ -254,6 +254,7 @@ final class WP_Customize_Manager {
|
||||
$this->prepare_controls();
|
||||
|
||||
wp_enqueue_script( 'customize-preview' );
|
||||
add_action( 'wp_head', array( $this, 'customize_preview_base' ) );
|
||||
add_action( 'wp_footer', array( $this, 'customize_preview_settings' ), 20 );
|
||||
|
||||
foreach ( $this->settings as $setting ) {
|
||||
@ -263,9 +264,17 @@ final class WP_Customize_Manager {
|
||||
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
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user