WordPress at Your Fingertips
function is not described

WP_Query::is_preview() public WP 3.1.0

Is the query for a post or page preview?

{} It's a method of the class: WP_Query{}

No Hooks.


true|false. Whether the query is for a post or page preview.


global $wp_query;

Code of WP_Query::is_preview() WP 5.8.3

public function is_preview() {
	return (bool) $this->is_preview;