is_customize_preview() WordPress Function

The is_customize_preview() function is used to check whether the current request is for a Customizer preview.

is_customize_preview() #

Whether the site is being previewed in the Customizer.


Return

(bool) True if the site is being previewed in the Customizer, false otherwise.


Top ↑

Source

File: wp-includes/theme.php

function is_customize_preview() {
	global $wp_customize;

	return ( $wp_customize instanceof WP_Customize_Manager ) && $wp_customize->is_preview();
}


Top ↑

Changelog

Changelog
VersionDescription
4.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More