WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 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').

Attachments (2)

category-template.diff (6.5 KB) - added by birgire 4 years ago.
36693-2.diff (6.4 KB) - added by birgire 4 years ago.
Fixed the extra indentation that came with my previous patch in the $hierarchical line.

Download all attachments as: .zip

Change History (6)

#1 @swissspidy
4 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 4.6

@birgire
4 years ago

Fixed the extra indentation that came with my previous patch in the $hierarchical line.

#2 @DrewAPicture
4 years ago

In 37569:

Docs: Add missing documentation for the style argument in the DocBlock for wp_list_categories().

Props birgire for the initial patch.
See #36693.

#3 @DrewAPicture
4 years ago

  • Type changed from enhancement to defect (bug)

#4 @DrewAPicture
4 years ago

  • Owner set to DrewAPicture
  • Resolution set to fixed
  • Status changed from new to closed

In 37571:

Docs: Reorder argument descriptions in the DocBlock for wp_list_categories() to match the default arguments list and improve reading at a glance.

Props birgire for the initial patch.
Fixes #36693.

Note: See TracTickets for help on using tickets.