* Query API: WP_Query class
* The WordPress Query class.
* @link https://developer.wordpress.org/reference/classes/wp_query/
* @since 4.5.0 Removed the `$comments_popup` property.
#[AllowDynamicProperties]
* Query vars set by the user.
* Query vars, after parsing.
public $query_vars = array();
* Taxonomy query, as passed to get_tax_sql().
* @var WP_Tax_Query|null A taxonomy query instance.
* Metadata query container.
* @var WP_Meta_Query A meta query instance.
public $meta_query = false;
* @var WP_Date_Query A date query instance.
public $date_query = false;
* Holds the data for a single object that is queried.
* Holds the contents of a post, page, category, attachment.
* @var WP_Term|WP_Post_Type|WP_Post|WP_User|null
* The ID of the queried object.
public $queried_object_id;
* SQL for the database query.
* Array of post objects or post IDs.
* The number of posts for the current query.
* Index of the current item in the loop.
public $current_post = -1;
* Whether the caller is before the loop.
public $before_loop = true;
* Whether the loop has started and the caller is in the loop.
public $in_the_loop = false;
* This property does not get populated when the `fields` argument is set to
* The list of comments for current post.
* The number of comments for the posts.
public $comment_count = 0;
* The index of the comment in the comment loop.
public $current_comment = -1;
* Current comment object.
* The number of found posts for the current query.
* If limit clause was not used, equals $post_count.
public $max_num_pages = 0;
* The number of comment pages.
public $max_num_comment_pages = 0;
* Signifies whether the current query is for a single post.
public $is_single = false;
* Signifies whether the current query is for a preview.
public $is_preview = false;
* Signifies whether the current query is for a page.
* Signifies whether the current query is for an archive.
public $is_archive = false;
* Signifies whether the current query is for a date archive.
* Signifies whether the current query is for a year archive.
* Signifies whether the current query is for a month archive.
public $is_month = false;
* Signifies whether the current query is for a day archive.
* Signifies whether the current query is for a specific time.
* Signifies whether the current query is for an author archive.
public $is_author = false;
* Signifies whether the current query is for a category archive.
public $is_category = false;
* Signifies whether the current query is for a tag archive.
* Signifies whether the current query is for a taxonomy archive.
* Signifies whether the current query is for a search.
public $is_search = false;
* Signifies whether the current query is for a feed.
* Signifies whether the current query is for a comment feed.
public $is_comment_feed = false;
* Signifies whether the current query is for trackback endpoint call.
public $is_trackback = false;
* Signifies whether the current query is for the site homepage.
* Signifies whether the current query is for the Privacy Policy page.
public $is_privacy_policy = false;
* Signifies whether the current query couldn't find anything.
* Signifies whether the current query is for an embed.
public $is_embed = false;
* Signifies whether the current query is for a paged result and not for the first page.
public $is_paged = false;
* Signifies whether the current query is for an administrative interface page.
public $is_admin = false;
* Signifies whether the current query is for an attachment page.
public $is_attachment = false;
* Signifies whether the current query is for an existing single post of any post type
* (post, attachment, page, custom post types).
public $is_singular = false;
* Signifies whether the current query is for the robots.txt file.
public $is_robots = false;
* Signifies whether the current query is for the favicon.ico file.
public $is_favicon = false;
* Signifies whether the current query is for the page_for_posts page.
* Basically, the homepage if the option isn't set for the static homepage.
public $is_posts_page = false;
* Signifies whether the current query is for a post type archive.
public $is_post_type_archive = false;
* Stores the ->query_vars state like md5(serialize( $this->query_vars ) ) so we know
* whether we have to re-parse because something has changed
private $query_vars_hash = false;
* Whether query vars have changed since the initial parse_query() call. Used to catch modifications to query vars made
* via pre_get_posts hooks.
private $query_vars_changed = true;
* Set if post thumbnails are cached
public $thumbnails_cached = false;
* Controls whether an attachment query should include filenames or not.
protected $allow_query_attachment_by_filename = false;
* Cached list of search stopwords.
private $compat_fields = array( 'query_vars_hash', 'query_vars_changed' );
private $compat_methods = array( 'init_query_flags', 'parse_tax_query' );
* The cache key generated by the query.
* The cache key is generated by the method ::generate_cache_key() after the
* query has been normalized.
private $query_cache_key = '';
* Resets query flags to false.
* The query flags are what page info WordPress was able to figure out.
private function init_query_flags() {
$this->is_single = false;
$this->is_preview = false;
$this->is_archive = false;