[ XREF Home ] [ Index ]

PHP Cross Reference of WordPress Trunk

Provided by Yoast

title

Body

[close]

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

(no description)

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

Defines 1 class

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


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: int $max_depth = 0 means display all levels; $max_depth > 0 specifies the number of display levels.
param: int $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



Generated: Wed Jun 1 08:30:02 2011 Cross-referenced by PHPXref 0.7
Provided by Yoast and awesome WordPress Hosting