Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 9 months ago

#51378 closed defect (bug) (fixed)

Taxonomy is missing from wp_list_categories inline documentation

Reported by: grapplerulrich's profile grapplerulrich Owned by: sergeybiryukov's profile 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.


4 years ago
#1

  • Keywords has-patch added

#2 @mukesh27
4 years ago

  • Keywords commit added; needs-docs removed

Thanks for the patch. Looks fine for me.

let's move this to commit

#3 @SergeyBiryukov
4 years ago

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

TimothyBJacobs commented on PR #546:


4 years ago
#4

Should this be Name of the _taxonomy_?

grappler commented on PR #546:


4 years ago
#5

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
4 years 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
4 years 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
4 years 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.

grappler commented on PR #546:


4 years ago
#9

Closing as it has been merged in trac.

Note: See TracTickets for help on using tickets.