Skip to content

Instantly share code, notes, and snippets.

@brettshumaker
Last active February 8, 2019 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brettshumaker/307d214cb59e4c12ecd2d837e39a1511 to your computer and use it in GitHub Desktop.
Save brettshumaker/307d214cb59e4c12ecd2d837e39a1511 to your computer and use it in GitHub Desktop.
$wp_query object
<?php
WP_Query::__set_state(
array(
'query' => array(),
'query_vars' => array(
'error' => '',
'm' => '',
'p' => 0,
'post_parent' => '',
'subpost' => '',
'subpost_id' => '',
'attachment' => '',
'attachment_id' => 0,
'name' => '',
'pagename' => '',
'page_id' => 0,
'second' => '',
'minute' => '',
'hour' => '',
'day' => 0,
'monthnum' => 0,
'year' => 0,
'w' => 0,
'category_name' => '',
'tag' => '',
'cat' => '',
'tag_id' => '',
'author' => '',
'author_name' => '',
'feed' => '',
'tb' => '',
'paged' => 0,
'meta_key' => '',
'meta_value' => '',
'preview' => '',
's' => '',
'sentence' => '',
'title' => '',
'menu_order' => '',
'embed' => '',
'category__in' => array(),
'category__not_in' => array(),
'category__and' => array(),
'post__not_in' => array(),
'post_name__in' => array(),
'tag__in' => array(),
'tag__not_in' => array(),
'tag__and' => array(),
'tag_slug__in' => array(),
'tag_slug__and' => array(),
'post_parent__in' => array(),
'post_parent__not_in' => array(),
'author__in' => array(),
'author__not_in' => array(),
'ignore_sticky_posts' => false,
'suppress_filters' => false,
'cache_results' => false,
'update_post_term_cache' => true,
'lazy_load_term_meta' => true,
'update_post_meta_cache' => true,
'nopaging' => false,
'comments_per_page' => '50',
'no_found_rows' => false,
'fields' => '',
'post__in' => array(),
'posts_per_page' => 10,
),
'tax_query' => WP_Tax_Query::__set_state(
array(
'queries' => array(),
'relation' => 'AND',
'table_aliases' => array(),
'queried_terms' => array(),
'primary_table' => null,
'primary_id_column' => null,
)
),
'meta_query' => WP_Meta_Query::__set_state(
array(
'queries' => array(),
'relation' => null,
'meta_table' => null,
'meta_id_column' => null,
'primary_table' => null,
'primary_id_column' => null,
'table_aliases' => array(),
'clauses' => array(),
'has_or_relation' => false,
)
),
'date_query' => false,
'queried_object' => null,
'queried_object_id' => null,
'request' => 'SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type = \'post\' AND (wp_posts.post_status = \'publish\' OR wp_posts.post_status = \'private\') ORDER BY FIELD( wp_posts.ID ) LIMIT 0, 10',
'posts' => null, // Contains an array of post objects if posts are found.
'post_count' => 0,
'current_post' => -1,
'in_the_loop' => false,
'post' => null, // Contains the current post object if posts are found
'comment_count' => 0,
'current_comment' => -1,
'found_posts' => 0,
'max_num_pages' => 0
'max_num_comment_pages' => 0,
'is_single' => false,
'is_preview' => false,
'is_page' => false,
'is_archive' => false,
'is_date' => false,
'is_year' => false,
'is_month' => false,
'is_day' => false,
'is_time' => false,
'is_author' => false,
'is_category' => false,
'is_tag' => false,
'is_tax' => false,
'is_search' => false,
'is_feed' => false,
'is_comment_feed' => false,
'is_trackback' => false,
'is_home' => false,
'is_404' => false,
'is_embed' => false,
'is_paged' => false,
'is_admin' => false,
'is_attachment' => false,
'is_singular' => false,
'is_robots' => false,
'is_posts_page' => false,
'is_post_type_archive' => false,
'query_vars_hash' => false,
'query_vars_changed' => true,
'thumbnails_cached' => false,
'stopwords' => null,
'compat_fields' => array(
0 => 'query_vars_hash',
1 => 'query_vars_changed',
),
'compat_methods' => array(
0 => 'init_query_flags',
1 => 'parse_tax_query',
),
'is_comments_popup' => null,
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment