Whether the site is being previewed in the Customizer.

Signature

is_customize_preview()

Return

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

Source

function is_customize_preview() {
	global $wp_customize;

	return is_a( $wp_customize, 'WP_Customize_Manager' ) && $wp_customize->is_preview();
}
WP Trac GitHub

Link here