WP_Query::is_preview() WordPress Method
The WP_Query::is_preview() function checks if the current query is for a post preview. This function is useful for conditionally displaying content based on whether the user is previewing a post.
WP_Query::is_preview() #
Is the query for a post or page preview?
Return
(bool) Whether the query is for a post or page preview.
Source
File: wp-includes/class-wp-query.php
public function is_preview() {
return (bool) $this->is_preview;
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 3.1.0 | Introduced. |