WP
- Since
- 2.0.0
- Source
wp-includes/class-wp.php:8
WordPress environment setup class.
Compatibility
- WordPress
- since 2.0.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Hooks and filters fired · 9
Every hook that fires from inside WP, in the order it appears in the class, grouped by the method that fires it.
WP::parse_request()
- apply_filters( do_parse_request )filter line 148
- apply_filters( query_vars )filter line 311
- apply_filters( request )filter line 409
- do_action( parse_request )action line 418
WP::send_headers()
- apply_filters( wp_headers )filter line 563
- do_action( send_headers )action line 598
WP::build_query_string()
- do_action( query_string )filter_deprecated line 633
WP::handle_404()
- apply_filters( pre_handle_404 )filter line 738
WP::main()
- do_action( wp )action line 838
Properties · 9
$public_query_varsstring[]public- Public query variables.
$private_query_varsstring[]public- Private query variables.
$extra_query_varsarraypublic- Extra query variables set by the user.
$query_varsarraypublic- Query variables for setting up the WordPress Query Loop.
$query_stringstringpublic- String parsed to set the query variables.
$requeststringpublic- The request path, e.g. 2015/05/06.
$matched_rulestringpublic- Rewrite rule the request matched.
$matched_querystringpublic- Rewrite query the request matched.
$did_permalinkboolpublic- Whether already did the permalink.
Methods · 11
- add_query_var()Adds a query variable to the list of public query variables.
- remove_query_var()Removes a query variable from a list of public query variables.
- set_query_var()Sets the value of a query variable.
- parse_request()Parses the request to find the correct WordPress query.
- send_headers()Sends additional HTTP headers for caching, content type, etc.
- build_query_string()Sets the query string property based off of the query variable property.
- register_globals()Set up the WordPress Globals.
- init()Set up the current user.
- query_posts()Set up the Loop based on the query variables.
- handle_404()Set the Headers for 404, if nothing is found for requested URL.
- main()Sets up all of the variables required by the WordPress environment.
Source code
#[AllowDynamicProperties]class WP { /** * Public query variables. * * Long list of public query variables. * * @since 2.0.0 * @var string[] */ public $public_query_vars = array( 'm', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'pagename', 'page_id', 'error', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'favicon', 'taxonomy', 'term', 'cpage', 'post_type', 'embed' ); /** * Private query variables. * * Long list of private query variables. * * @since 2.0.0 * @var string[] */ public $private_query_vars = array( 'offset', 'posts_per_page', 'posts_per_archive_page', 'showposts', 'nopaging', 'post_type', 'post_status', 'category__in', 'category__not_in', 'category__and', 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'tag_id', 'post_mime_type', 'perm', 'comments_per_page', 'post__in', 'post__not_in', 'post_parent', 'post_parent__in', 'post_parent__not_in', 'title', 'fields' ); /** * Extra query variables set by the user. * * @since 2.1.0 * @var array */ public $extra_query_vars = array(); /** * Query variables for setting up the WordPress Query Loop. * * @since 2.0.0 * @var array */ public $query_vars = array(); /** * String parsed to set the query variables. * * @since 2.0.0 * @var string */ public $query_string = ''; /** * The request path, e.g. 2015/05/06. * * @since 2.0.0 * @var string */ public $request = ''; /** * Rewrite rule the request matched. * * @since 2.0.0 * @var string */ public $matched_rule = ''; /** * Rewrite query the request matched. * * @since 2.0.0 * @var string */ public $matched_query = ''; /** * Whether already did the permalink. * * @since 2.0.0 * @var bool */ public $did_permalink = false; /** * Adds a query variable to the list of public query variables.Changelog
Introduced in 2.0.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.9.7 tag, from
src/wp-includes/class-wp.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.