mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
Add is_customize_preview(), a conditional function to check if the site is being previewed in the Customizer.
props sammybeats, mattwiebe. fixes #23509. Built from https://develop.svn.wordpress.org/trunk@28999 git-svn-id: http://core.svn.wordpress.org/trunk@28787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
53bd731570
commit
7197468003
@ -1938,3 +1938,16 @@ function wp_customize_support_script() {
|
|||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the site is being previewed in the Customizer.
|
||||||
|
*
|
||||||
|
* @since 4.0.0
|
||||||
|
*
|
||||||
|
* @return bool True if the site is being previewed in the Customizer, false otherwise.
|
||||||
|
*/
|
||||||
|
function is_customize_preview() {
|
||||||
|
global $wp_customize;
|
||||||
|
|
||||||
|
return is_a( $wp_customize, 'WP_Customize_Manager' ) && $wp_customize->is_preview();
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user