Opened 8 years ago
Closed 8 years ago
#36693 closed defect (bug) (fixed)
Documentation: Missing argument (style) in the wp_list_categories() function's docblock
Reported by: | birgire | Owned by: | DrewAPicture |
---|---|---|---|
Milestone: | 4.6 | Priority: | normal |
Severity: | normal | Version: | 4.6 |
Component: | Taxonomy | Keywords: | has-patch |
Focuses: | docs | Cc: |
Description
The 'style'
input argument is missing in the wp_list_categories()
function's DocBlock.
I also ordered the DocBlock's arguments alphabetically, because that's easier to read and the default array is also ordered that way.
To consider:
The 'class'
and 'pad_counts'
arguments are also explicitly checked for in wp_list_categories()
but they aren't part of the function's docblock:
if ( ! isset( $r['class'] ) ) $r['class'] = ( 'category' == $r['taxonomy'] ) ? 'categories' : $r['taxonomy'];
and
if ( !isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) $r['pad_counts'] = true;
I also wonder if we should document the 'include'
argument or add a reference to the get_the_categories()
function or the get_terms()
function for other supported input arguments.
But I'm not sure how that would fit the documentation rules.
The old Codex page on WayBack Machine:
https://web.archive.org/web/20150420185400/https://codex.wordpress.org/Function_Reference/wp_list_categories
did mention the 'style'
and 'pad_counts'
input parameters (and also 'walker'
).
Fixed the extra indentation that came with my previous patch in the $hierarchical line.