WordPress.org

Make WordPress Core

Opened 14 months ago

Closed 14 months ago

Last modified 14 months ago

#51378 closed defect (bug) (fixed)

Taxonomy is missing from wp_list_categories inline documentation

Reported by: grapplerulrich Owned by: SergeyBiryukov
Milestone: 5.6 Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: has-patch commit
Focuses: docs Cc:

Description

The taxonomy parameter is not documented in the inline documentation.

https://developer.wordpress.org/reference/functions/wp_list_categories/

Something like this should be added.

@type string $taxonomy Name of the category to retrieve. Default 'category'.

Change History (9)

This ticket was mentioned in PR #546 on WordPress/wordpress-develop by grappler.


14 months ago

  • Keywords has-patch added

#2 @mukesh27
14 months ago

  • Keywords commit added; needs-docs removed

Thanks for the patch. Looks fine for me.

let's move this to commit

#3 @SergeyBiryukov
14 months ago

  • Milestone changed from Awaiting Review to 5.6
  • Owner set to SergeyBiryukov
  • Status changed from assigned to reviewing

#4 @prbot
14 months ago

TimothyBJacobs commented on PR #546:

Should this be Name of the _taxonomy_?

#5 @prbot
14 months ago

grappler commented on PR #546:

Thanks! 🤦 That is the problem when one copy and pastes. It is corrected now.

BTW Love this feature. Makes it so much easier for me to contribute.

#6 @SergeyBiryukov
14 months ago

In 49059:

Docs: Correct description for the taxonomy parameter of wp_dropdown_categories().

Follow-up to [40903], [41767].

Props grapplerulrich, mukesh27, TimothyBlynJacobs.
See #51378.

#7 @SergeyBiryukov
14 months ago

Thanks for the PR! The first part of it is now committed.

Some history on the second part:

  • The description of the taxonomy argument in wp_list_categories() was intentionally removed in [45894], see comment:12:ticket:47896 and comment:8:ticket:41058 for the reasoning. The DocBlock includes a reference to get_categories(), get_terms(), and WP_Term_Query::__construct() for information on additional accepted arguments.
  • That said, the same was done for wp_dropdown_categories(). The taxonomy parameter was removed in [40903] and then reinstated in [41767], since it's different from the default in WP_Term_Query::__construct().
  • With the above in mind, it should probably be reinstated for wp_list_categories() too.

#8 @SergeyBiryukov
14 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 49060:

Taxonomy: Restore documentation for the taxonomy parameter of wp_list_categories().

The parameter's default value is different from the one in WP_Term_Query::__construct(), and should be documented accordingly.

This also clarifies that the taxonomy parameter of wp_list_categories() only accepts a string, not an array.

Follow-up to [40903], [41767], [45894], [45895].

Props grapplerulrich, mukesh27, TimothyBlynJacobs, SergeyBiryukov.
Fixes #51378. See #47896.

#9 @prbot
14 months ago

grappler commented on PR #546:

Closing as it has been merged in trac.

Note: See TracTickets for help on using tickets.