Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
wp-includes
/
js
/
dist
:
class-wp-query.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php /** * Query API: WP_Query class * * @package WordPress * @subpackage Query * @since 4.7.0 */ /** * The WordPress Query class. * * @link https://developer.wordpress.org/reference/classes/wp_query/ * * @since 1.5.0 * @since 4.5.0 Removed the `$comments_popup` property. */ #[AllowDynamicProperties] class WP_Query { /** * Query vars set by the user. * * @since 1.5.0 * @var array */ public $query; /** * Query vars, after parsing. * * @since 1.5.0 * @var array */ public $query_vars = array(); /** * Taxonomy query, as passed to get_tax_sql(). * * @since 3.1.0 * @var WP_Tax_Query|null A taxonomy query instance. */ public $tax_query; /** * Metadata query container. * * @since 3.2.0 * @var WP_Meta_Query A meta query instance. */ public $meta_query = false; /** * Date query container. * * @since 3.7.0 * @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. * * @since 1.5.0 * @var WP_Term|WP_Post_Type|WP_Post|WP_User|null */ public $queried_object; /** * The ID of the queried object. * * @since 1.5.0 * @var int */ public $queried_object_id; /** * SQL for the database query. * * @since 2.0.1 * @var string */ public $request; /** * Array of post objects or post IDs. * * @since 1.5.0 * @var WP_Post[]|int[] */ public $posts; /** * The number of posts for the current query. * * @since 1.5.0 * @var int */ public $post_count = 0; /** * Index of the current item in the loop. * * @since 1.5.0 * @var int */ public $current_post = -1; /** * Whether the caller is before the loop. * * @since 6.3.0 * @var bool */ public $before_loop = true; /** * Whether the loop has started and the caller is in the loop. * * @since 2.0.0 * @var bool */ public $in_the_loop = false; /** * The current post. * * This property does not get populated when the `fields` argument is set to * `ids` or `id=>parent`. * * @since 1.5.0 * @var WP_Post|null */ public $post; /** * The list of comments for current post. * * @since 2.2.0 * @var WP_Comment[] */ public $comments; /** * The number of comments for the posts. * * @since 2.2.0 * @var int */ public $comment_count = 0; /** * The index of the comment in the comment loop. * * @since 2.2.0 * @var int */ public $current_comment = -1; /** * Current comment object. * * @since 2.2.0 * @var WP_Comment */ public $comment; /** * The number of found posts for the current query. * * If limit clause was not used, equals $post_count. * * @since 2.1.0 * @var int */ public $found_posts = 0; /** * The number of pages. * * @since 2.1.0 * @var int */ public $max_num_pages = 0; /** * The number of comment pages. * * @since 2.7.0 * @var int */ public $max_num_comment_pages = 0; /** * Signifies whether the current query is for a single post. * * @since 1.5.0 * @var bool */ public $is_single = false; /** * Signifies whether the current query is for a preview. * * @since 2.0.0 * @var bool */ public $is_preview = false; /** * Signifies whether the current query is for a page. * * @since 1.5.0 * @var bool */ public $is_page = false; /** * Signifies whether the current query is for an archive. * * @since 1.5.0 * @var bool */ public $is_archive = false; /** * Signifies whether the current query is for a date archive. * * @since 1.5.0 * @var bool */ public $is_date = false; /** * Signifies whether the current query is for a year archive. * * @since 1.5.0 * @var bool */ public $is_year = false; /** * Signifies whether the current query is for a month archive. * * @since 1.5.0 * @var bool */ public $is_month = false; /** * Signifies whether the current query is for a day archive. * * @since 1.5.0 * @var bool */ public $is_day = false; /** * Signifies whether the current query is for a specific time. * * @since 1.5.0 * @var bool */ public $is_time = false; /** * Signifies whether the current query is for an author archive. * * @since 1.5.0 * @var bool */ public $is_author = false; /** * Signifies whether the current query is for a category archive. * * @since 1.5.0 * @var bool */ public $is_category = false; /** * Signifies whether the current query is for a tag archive. * * @since 2.3.0 * @var bool */ public $is_tag = false; /** * Signifies whether the current query is for a taxonomy archive. * * @since 2.5.0 * @var bool */ public $is_tax = false; /** * Signifies whether the current query is for a search. * * @since 1.5.0 * @var bool */ public $is_search = false; /** * Signifies whether the current query is for a feed. * * @since 1.5.0 * @var bool */ public $is_feed = false; /** * Signifies whether the current query is for a comment feed. * * @since 2.2.0 * @var bool */ public $is_comment_feed = false; /** * Signifies whether the current query is for trackback endpoint call. * * @since 1.5.0 * @var bool */ public $is_trackback = false; /** * Signifies whether the current query is for the site homepage. * * @since 1.5.0 * @var bool */ public $is_home = false; /** * Signifies whether the current query is for the Privacy Policy page. * * @since 5.2.0 * @var bool */ public $is_privacy_policy = false; /** * Signifies whether the current query couldn't find anything. * * @since 1.5.0 * @var bool */ public $is_404 = false; /** * Signifies whether the current query is for an embed. * * @since 4.4.0 * @var bool */ public $is_embed = false; /** * Signifies whether the current query is for a paged result and not for the first page. * * @since 1.5.0 * @var bool */ public $is_paged = false; /** * Signifies whether the current query is for an administrative interface page. * * @since 1.5.0 * @var bool */ public $is_admin = false; /** * Signifies whether the current query is for an attachment page. * * @since 2.0.0 * @var bool */ 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). * * @since 2.1.0 * @var bool */ public $is_singular = false; /** * Signifies whether the current query is for the robots.txt file. * * @since 2.1.0 * @var bool */ public $is_robots = false; /** * Signifies whether the current query is for the favicon.ico file. * * @since 5.4.0 * @var bool */ 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. * * @since 2.1.0 * @var bool */ public $is_posts_page = false; /** * Signifies whether the current query is for a post type archive. * * @since 3.1.0 * @var bool */ 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 * * @since 3.1.0 * @var bool|string */ 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. * * @since 3.1.1 */ private $query_vars_changed = true; /** * Set if post thumbnails are cached * * @since 3.2.0 * @var bool */ public $thumbnails_cached = false; /** * Controls whether an attachment query should include filenames or not. * * @since 6.0.3 * @var bool */ protected $allow_query_attachment_by_filename = false; /** * Cached list of search stopwords. * * @since 3.7.0 * @var array */ private $stopwords; private $compat_fields = array( 'query_vars_hash', 'query_vars_changed'