[ Index ]

PHP Cross Reference of Wordpress 2.9.1

title

Body

[close]

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

Holds Most of the WordPress classes. Some of the other classes are contained in other files. For example, the WordPress cache is in cache.php and the WordPress roles API is in capabilities.php. The third party libraries are contained in their own separate files.

File Size: 1685 lines (47 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 9 classes

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

WP_Error:: (9 methods):
  WP_Error()
  get_error_codes()
  get_error_code()
  get_error_messages()
  get_error_message()
  get_error_data()
  add()
  add_data()
  is_wp_error()

Walker:: (9 methods):
  start_lvl()
  end_lvl()
  start_el()
  end_el()
  display_element()
  walk()
  paged_walk()
  get_number_of_root_elements()
  unset_children()

Walker_Page:: (4 methods):
  start_lvl()
  end_lvl()
  start_el()
  end_el()

Walker_PageDropdown:: (1 method):
  start_el()

Walker_Category:: (4 methods):
  start_lvl()
  end_lvl()
  start_el()
  end_el()

Walker_CategoryDropdown:: (1 method):
  start_el()

WP_Ajax_Response:: (3 methods):
  WP_Ajax_Response()
  add()
  send()

WP_MatchesMapRegex:: (4 methods):
  WP_MatchesMapRegex()
  apply()
  _map()
  callback()


Class: WP  - X-Ref

WordPress environment setup class.

add_query_var($qv)   X-Ref
Add name to list of public query variables.

param: string $qv Query variable name.

set_query_var($key, $value)   X-Ref
Set 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
Parse request to find 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.

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

Sets the X-Pingback header, 404 status (if 404), Content-type. 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 'query_string' filter is deprecated, but still works. Plugins should
use the 'request' filter instead.


register_globals()   X-Ref
Setup 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
Setup the current user.


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


handle_404()   X-Ref
Set the Headers for 404, if permalink is not found.

Issue a 404 if a permalink request doesn't match any posts.  Don't issue
a 404 if one was already issued, if the request was a search, or if the
request was a regular query string request rather than a permalink
request. Issues a 200, if not 404.


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

The action '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 {@link parse_request()}

WP()   X-Ref
PHP4 Constructor - Does nothing.

Call main() method when ready to run setup.

return: WP

Class: WP_Error  - X-Ref

WordPress Error class.

Container for checking for WordPress errors and error messages. Return
WP_Error and use {@link is_wp_error()} to check if this class is returned.
Many core WordPress functions pass this class in the event of an error and
if not handled properly will result in code errors.

WP_Error($code = '', $message = '', $data = '')   X-Ref
PHP4 Constructor - Sets up error message.

If code parameter is empty then nothing will be done. It is possible to
add multiple messages to the same code, but with other methods in the
class.

All parameters are optional, but if the code parameter is set, then the
data parameter is optional.

param: string|int $code Error code
param: string $message Error message
param: mixed $data Optional. Error data.
return: WP_Error

get_error_codes()   X-Ref
Retrieve all error codes.

return: array List of error codes, if avaiable.

get_error_code()   X-Ref
Retrieve first error code available.

return: string|int Empty string, if no error codes.

get_error_messages($code = '')   X-Ref
Retrieve all error messages or error messages matching code.

param: string|int $code Optional. Retrieve messages matching code, if exists.
return: array Error strings on success, or empty array on failure (if using codee parameter).

get_error_message($code = '')   X-Ref
Get single error message.

This will get the first message available for the code. If no code is
given then the first code available will be used.

param: string|int $code Optional. Error code to retrieve message.
return: string

get_error_data($code = '')   X-Ref
Retrieve error data for error code.

param: string|int $code Optional. Error code.
return: mixed Null, if no errors.

add($code, $message, $data = '')   X-Ref
Append more error messages to list of error messages.

param: string|int $code Error code.
param: string $message Error message.
param: mixed $data Optional. Error data.

add_data($data, $code = '')   X-Ref
Add data for error code.

The error code can only contain one error data.

param: mixed $data Error data.
param: string|int $code Error code.

is_wp_error($thing)   X-Ref
Check whether variable is a WordPress Error.

Looks at the object and if a WP_Error class. Does not check to see if the
parent is also WP_Error, so can't inherit WP_Error and still use this
function.

param: mixed $thing Check if unknown variable is WordPress Error object.
return: bool True, if WP_Error. False, if not WP_Error.

Class: Walker  - X-Ref

A class for displaying various tree-like structures.

Extend the Walker class to use it, see examples at the below. Child classes
do not need to implement all of the abstract methods in the class. The child
only needs to implement the methods that are needed. Also, the methods are
not strictly abstract in that the parameter definition needs to be followed.
The child classes can have additional parameters.

start_lvl(&$output)   X-Ref
Starts the list before the elements are added.

Additional parameters are used in child classes. The args parameter holds
additional values that may be used with the child class methods. This
method is called at the start of the output list.

param: string $output Passed by reference. Used to append additional content.

end_lvl(&$output)   X-Ref
Ends the list of after the elements are added.

Additional parameters are used in child classes. The args parameter holds
additional values that may be used with the child class methods. This
method finishes the list at the end of output of the elements.

param: string $output Passed by reference. Used to append additional content.

start_el(&$output)   X-Ref
Start the element output.

Additional parameters are used in child classes. The args parameter holds
additional values that may be used with the child class methods. Includes
the element output also.

param: string $output Passed by reference. Used to append additional content.

end_el(&$output)   X-Ref
Ends the element output, if needed.

Additional parameters are used in child classes. The args parameter holds
additional values that may be used with the child class methods.

param: string $output Passed by reference. Used to append additional content.

display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output )   X-Ref
Traverse elements to create list from elements.

Display one element if the element doesn't have any children otherwise,
display the element and its children. Will only traverse up to the max
depth and no ignore elements under that depth. It is possible to set the
max depth to include all depths, see walk() method.

This method shouldn't be called directly, use the walk() method instead.

param: object $element Data object
param: array $children_elements List of elements to continue traversing.
param: int $max_depth Max depth to traverse.
param: int $depth Depth of current element.
param: array $args
param: string $output Passed by reference. Used to append additional content.
return: null Null on failure with no changes to parameters.

walk( $elements, $max_depth)   X-Ref
Display array of elements hierarchically.

It is a generic function which does not assume any existing order of
elements. max_depth = -1 means flatly display every element. max_depth =
0 means display all levels. max_depth > 0  specifies the number of
display levels.

param: array $elements
param: int $max_depth
return: string

paged_walk( $elements, $max_depth, $page_num, $per_page )   X-Ref
paged_walk() - produce a page of nested elements

Given an array of hierarchical elements, the maximum depth, a specific page number,
and number of elements per page, this function first determines all top level root elements
belonging to that page, then lists them and all of their children in hierarchical order.

param: $max_depth = 0  means display all levels; $max_depth > 0  specifies the number of display levels.
param: $page_num the specific page number, beginning with 1.
return: XHTML of the specified page of elements

get_number_of_root_elements( $elements )   X-Ref
No description

unset_children( $e, &$children_elements )   X-Ref
No description

Class: Walker_Page  - X-Ref

Create HTML list of pages.

start_lvl(&$output, $depth)   X-Ref

param: string $output Passed by reference. Used to append additional content.
param: int $depth Depth of page. Used for padding.

end_lvl(&$output, $depth)   X-Ref

param: string $output Passed by reference. Used to append additional content.
param: int $depth Depth of page. Used for padding.

start_el(&$output, $page, $depth, $args, $current_page)   X-Ref

param: string $output Passed by reference. Used to append additional content.
param: object $page Page data object.
param: int $depth Depth of page. Used for padding.
param: int $current_page Page ID.
param: array $args

end_el(&$output, $page, $depth)   X-Ref

param: string $output Passed by reference. Used to append additional content.
param: object $page Page data object. Not used.
param: int $depth Depth of page. Not Used.

Class: Walker_PageDropdown  - X-Ref

Create HTML dropdown list of pages.

start_el(&$output, $page, $depth, $args)   X-Ref

param: string $output Passed by reference. Used to append additional content.
param: object $page Page data object.
param: int $depth Depth of page in reference to parent pages. Used for padding.
param: array $args Uses 'selected' argument for selected page to set selected HTML attribute for option element.

Class: Walker_Category  - X-Ref

Create HTML list of categories.

start_lvl(&$output, $depth, $args)   X-Ref

param: string $output Passed by reference. Used to append additional content.
param: int $depth Depth of category. Used for tab indentation.
param: array $args Will only append content if style argument value is 'list'.

end_lvl(&$output, $depth, $args)   X-Ref

param: string $output Passed by reference. Used to append additional content.
param: int $depth Depth of category. Used for tab indentation.
param: array $args Will only append content if style argument value is 'list'.

start_el(&$output, $category, $depth, $args)   X-Ref

param: string $output Passed by reference. Used to append additional content.
param: object $category Category data object.
param: int $depth Depth of category in reference to parents.
param: array $args

end_el(&$output, $page, $depth, $args)   X-Ref

param: string $output Passed by reference. Used to append additional content.
param: object $page Not used.
param: int $depth Depth of category. Not used.
param: array $args Only uses 'list' for whether should append to output.

Class: Walker_CategoryDropdown  - X-Ref

Create HTML dropdown list of Categories.

start_el(&$output, $category, $depth, $args)   X-Ref

param: string $output Passed by reference. Used to append additional content.
param: object $category Category data object.
param: int $depth Depth of category. Used for padding.
param: array $args Uses 'selected', 'show_count', and 'show_last_update' keys, if they exist.

Class: WP_Ajax_Response  - X-Ref

Send XML response back to AJAX request.

WP_Ajax_Response( $args = '' )   X-Ref
PHP4 Constructor - Passes args to {@link WP_Ajax_Response::add()}.

param: string|array $args Optional. Will be passed to add() method.
return: WP_Ajax_Response

add( $args = '' )   X-Ref
Append to XML response based on given arguments.

The arguments that can be passed in the $args parameter are below. It is
also possible to pass a WP_Error object in either the 'id' or 'data'
argument. The parameter isn't actually optional, content should be given
in order to send the correct response.

'what' argument is a string that is the XMLRPC response type.
'action' argument is a boolean or string that acts like a nonce.
'id' argument can be WP_Error or an integer.
'old_id' argument is false by default or an integer of the previous ID.
'position' argument is an integer or a string with -1 = top, 1 = bottom,
html ID = after, -html ID = before.
'data' argument is a string with the content or message.
'supplemental' argument is an array of strings that will be children of
the supplemental element.

param: string|array $args Override defaults.
return: string XML response.

send()   X-Ref
Display XML formatted responses.

Sets the content type header to text/xml.


Class: WP_MatchesMapRegex  - X-Ref

Helper class to remove the need to use eval to replace $matches[] in query strings.

WP_MatchesMapRegex($subject, $matches)   X-Ref
constructor

param: string $subject subject if regex
param: array  $matches data to use in map
return: self

apply($subject, $matches)   X-Ref
Substitute substring matches in subject.

static helper function to ease use

param: string $subject subject
param: array  $matches data used for subsitution
return: string

_map()   X-Ref
do the actual mapping

return: string

callback($matches)   X-Ref
preg_replace_callback hook

param: array $matches preg_replace regexp matches
return: string



Generated: Fri Jan 8 00:19:48 2010 Cross-referenced by PHPXref 0.7