[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/ -> class-wp.php (summary)

(no description)

File Size: 832 lines (26 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP:: (11 methods):
  add_query_var()
  remove_query_var()
  set_query_var()
  parse_request()
  send_headers()
  build_query_string()
  register_globals()
  init()
  query_posts()
  handle_404()
  main()


Class: WP  - X-Ref

WordPress environment setup class.

add_query_var( $qv )   X-Ref
Adds a query variable to the list of public query variables.

param: string $qv Query variable name.

remove_query_var( $name )   X-Ref
Removes a query variable from a list of public query variables.

param: string $name Query variable name.

set_query_var( $key, $value )   X-Ref
Sets the value of a query variable.

param: string $key   Query variable name.
param: mixed  $value Query variable value.

parse_request( $extra_query_vars = '' )   X-Ref
Parses the request to find the correct WordPress query.

Sets up the query variables based on the request. There are also many
filters and actions that can be used to further manipulate the result.

param: array|string $extra_query_vars Set the extra query variables.
return: bool Whether the request was parsed.

send_headers()   X-Ref
Sends additional HTTP headers for caching, content type, etc.

Sets the Content-Type header. Sets the 'error' status (if passed) and optionally exits.
If showing a feed, it will also send Last-Modified, ETag, and 304 status if needed.


build_query_string()   X-Ref
Sets the query string property based off of the query variable property.

The {@see 'query_string'} filter is deprecated, but still works. Plugins should
use the {@see 'request'} filter instead.


register_globals()   X-Ref
Set up the WordPress Globals.

The query_vars property will be extracted to the GLOBALS. So care should
be taken when naming global variables that might interfere with the
WordPress environment.


init()   X-Ref
Set up the current user.


query_posts()   X-Ref
Set up the Loop based on the query variables.


handle_404()   X-Ref
Set the Headers for 404, if nothing is found for requested URL.

Issue a 404 if a request doesn't match any posts and doesn't match any object
(e.g. an existing-but-empty category, tag, author) and a 404 was not already issued,
and if the request was not a search or the homepage.

Otherwise, issue a 200.

This sets headers after posts have been queried. handle_404() really means "handle status".
By inspecting the result of querying posts, seemingly successful requests can be switched to
a 404 so that canonical redirection logic can kick in.


main( $query_args = '' )   X-Ref
Sets up all of the variables required by the WordPress environment.

The action {@see 'wp'} has one parameter that references the WP object. It
allows for accessing the properties and methods to further manipulate the
object.

param: string|array $query_args Passed to parse_request().



Generated : Tue Mar 19 08:20:01 2024 Cross-referenced by PHPXref