[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

(no description)

File Size: 789 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.
since: 2.1.0

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

param: string $name Query variable name.
since: 4.5.0

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.
since: 2.3.0

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.

return: bool Whether the request was parsed.
param: array|string $extra_query_vars Set the extra query variables.
since: 2.0.0
since: 6.0.0 A return value was added.

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.

since: 2.0.0
since: 4.4.0 `X-Pingback` header is added conditionally after posts have been queried in handle_404().

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.

since: 2.0.0

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.

since: 2.0.0

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

since: 2.0.0

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

since: 2.0.0

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.

since: 2.0.0

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().
since: 2.0.0



Generated: Thu Nov 21 01:00:03 2024 Cross-referenced by PHPXref 0.7.1