Is the query for a post or page preview?

Signature

is_preview()

Return

(boolean)

Source

function is_preview() {
	global $wp_query;

	if ( ! isset( $wp_query ) ) {
		_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
		return false;
	}

	return $wp_query->is_preview();
}
WP Trac GitHub

Link here