[ Index ]

WordPress Cross Reference

title

Body

[close]

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

(no description)

File Size: 408 lines (12 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 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.

start_lvl( &$output, $depth = 0, $args = array()   X-Ref
Starts the list before the elements are added.

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.
param: int    $depth  Depth of the item.
param: array  $args   An array of additional arguments.

end_lvl( &$output, $depth = 0, $args = array()   X-Ref
Ends the list of after the elements are added.

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.
param: int    $depth  Depth of the item.
param: array  $args   An array of additional arguments.

start_el( &$output, $object, $depth = 0, $args = array()   X-Ref
Start the element output.

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.
param: object $object            The data object.
param: int    $depth             Depth of the item.
param: array  $args              An array of additional arguments.
param: int    $current_object_id ID of the current item.

end_el( &$output, $object, $depth = 0, $args = array()   X-Ref
Ends the element output, if needed.

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.
param: object $object The data object.
param: int    $depth  Depth of the item.
param: array  $args   An array of additional arguments.

display_element( $element, &$children_elements, $max_depth, $depth, $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 should not 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              An array of arguments.
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.

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  An array of elements.
param: int   $max_depth The maximum hierarchical depth.
return: string The hierarchical item output.

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.

$max_depth = 0 means display all levels.
$max_depth > 0 specifies the number of display levels.

param: int $max_depth The maximum hierarchical depth.
param: int $page_num  The specific page number, beginning with 1.
return: string 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: Tue Mar 25 01:41:18 2014 WordPress honlapkészítés: online1.hu