Inline documentation improvements for `Walker_Category` and `Walker_CategoryDropdown`.

Also covers previously undocumented parameters.

See #23406, #19249.


git-svn-id: https://develop.svn.wordpress.org/trunk@25641 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Drew Jaynes 2013-09-28 18:01:26 +00:00
parent 50a1bb0eb2
commit 67342ade09
1 changed files with 34 additions and 13 deletions

View File

@ -763,6 +763,8 @@ function walk_category_dropdown_tree() {
*/ */
class Walker_Category extends Walker { class Walker_Category extends Walker {
/** /**
* What the class handles.
*
* @see Walker::$tree_type * @see Walker::$tree_type
* @since 2.1.0 * @since 2.1.0
* @var string * @var string
@ -770,6 +772,8 @@ class Walker_Category extends Walker {
var $tree_type = 'category'; var $tree_type = 'category';
/** /**
* Database fields to use.
*
* @see Walker::$db_fields * @see Walker::$db_fields
* @since 2.1.0 * @since 2.1.0
* @todo Decouple this * @todo Decouple this
@ -778,12 +782,16 @@ class Walker_Category extends Walker {
var $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); var $db_fields = array ('parent' => 'parent', 'id' => 'term_id');
/** /**
* Starts the list before the elements are added.
*
* @see Walker::start_lvl() * @see Walker::start_lvl()
*
* @since 2.1.0 * @since 2.1.0
* *
* @param string $output Passed by reference. Used to append additional content. * @param string $output Passed by reference. Used to append additional content.
* @param int $depth Depth of category. Used for tab indentation. * @param int $depth Depth of category. Used for tab indentation.
* @param array $args Will only append content if style argument value is 'list'. * @param array $args An array of arguments. Will only append content if style argument value is 'list'.
* @see wp_list_categories()
*/ */
function start_lvl( &$output, $depth = 0, $args = array() ) { function start_lvl( &$output, $depth = 0, $args = array() ) {
if ( 'list' != $args['style'] ) if ( 'list' != $args['style'] )
@ -794,12 +802,16 @@ class Walker_Category extends Walker {
} }
/** /**
* Ends the list of after the elements are added.
*
* @see Walker::end_lvl() * @see Walker::end_lvl()
*
* @since 2.1.0 * @since 2.1.0
* *
* @param string $output Passed by reference. Used to append additional content. * @param string $output Passed by reference. Used to append additional content.
* @param int $depth Depth of category. Used for tab indentation. * @param int $depth Depth of category. Used for tab indentation.
* @param array $args Will only append content if style argument value is 'list'. * @param array $args An array of arguments. Will only append content if style argument value is 'list'.
* @wsee wp_list_categories()
*/ */
function end_lvl( &$output, $depth = 0, $args = array() ) { function end_lvl( &$output, $depth = 0, $args = array() ) {
if ( 'list' != $args['style'] ) if ( 'list' != $args['style'] )
@ -810,13 +822,17 @@ class Walker_Category extends Walker {
} }
/** /**
* Start the element output.
*
* @see Walker::start_el() * @see Walker::start_el()
*
* @since 2.1.0 * @since 2.1.0
* *
* @param string $output Passed by reference. Used to append additional content. * @param string $output Passed by reference. Used to append additional content.
* @param object $category Category data object. * @param object $category Category data object.
* @param int $depth Depth of category in reference to parents. * @param int $depth Depth of category in reference to parents. Default 0.
* @param array $args * @param array $args An array of arguments. @see wp_list_categories()
* @param int $id ID of the current category.
*/ */
function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
extract($args); extract($args);
@ -882,13 +898,16 @@ class Walker_Category extends Walker {
} }
/** /**
* Ends the element output, if needed.
*
* @see Walker::end_el() * @see Walker::end_el()
*
* @since 2.1.0 * @since 2.1.0
* *
* @param string $output Passed by reference. Used to append additional content. * @param string $output Passed by reference. Used to append additional content.
* @param object $page Not used. * @param object $page Not used.
* @param int $depth Depth of category. Not used. * @param int $depth Depth of category. Not used.
* @param array $args Only uses 'list' for whether should append to output. * @param array $args An array of arguments. Only uses 'list' for whether should append to output. @see wp_list_categories()
*/ */
function end_el( &$output, $page, $depth = 0, $args = array() ) { function end_el( &$output, $page, $depth = 0, $args = array() ) {
if ( 'list' != $args['style'] ) if ( 'list' != $args['style'] )
@ -923,13 +942,15 @@ class Walker_CategoryDropdown extends Walker {
var $db_fields = array ('parent' => 'parent', 'id' => 'term_id'); var $db_fields = array ('parent' => 'parent', 'id' => 'term_id');
/** /**
* Start the element output.
*
* @see Walker::start_el() * @see Walker::start_el()
* @since 2.1.0 * @since 2.1.0
* *
* @param string $output Passed by reference. Used to append additional content. * @param string $output Passed by reference. Used to append additional content.
* @param object $category Category data object. * @param object $category Category data object.
* @param int $depth Depth of category. Used for padding. * @param int $depth Depth of category. Used for padding.
* @param array $args Uses 'selected' and 'show_count' keys, if they exist. * @param array $args Uses 'selected' and 'show_count' keys, if they exist. @see wp_dropdown_categories()
*/ */
function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
$pad = str_repeat(' ', $depth * 3); $pad = str_repeat(' ', $depth * 3);