is_customize_preview(): bool

Whether the site is being previewed in the Customizer.

Return

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

Source

function is_customize_preview() {
	global $wp_customize;

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

Changelog

VersionDescription
4.0.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.