Opened 6 years ago
Closed 6 years ago
#45766 closed enhancement (fixed)
Doc: wp_list_sort() wrong DocBlock tag defination
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.1 | Priority: | low |
Severity: | trivial | Version: | 4.7 |
Component: | General | Keywords: | has-patch commit |
Focuses: | docs | Cc: |
Description
wp_list_sort()
function is used in sorting a list of objects. This takes an array of objects as the first argument to sort. In the DocBlock its written as "An array of objects to filter." instead of "An array of objects to sort."
File Path wp-includes/functions.php
DocBlock should be
/** * Sorts a list of objects, based on one or more orderby arguments. * * @since 4.7.0 * * @param array $list An array of objects to short. * @param string|array $orderby Optional. Either the field name to order by or an array * of multiple orderby fields as $orderby => $order. * @param string $order Optional. Either 'ASC' or 'DESC'. Only used if $orderby * is a string. * @param bool $preserve_keys Optional. Whether to preserve keys. Default false. * @return array The sorted array. */
Instead of
/** * Sorts a list of objects, based on one or more orderby arguments. * * @since 4.7.0 * * @param array $list An array of objects to filter. * @param string|array $orderby Optional. Either the field name to order by or an array * of multiple orderby fields as $orderby => $order. * @param string $order Optional. Either 'ASC' or 'DESC'. Only used if $orderby * is a string. * @param bool $preserve_keys Optional. Whether to preserve keys. Default false. * @return array The sorted array. */
From
* @param array $list An array of objects to filter.
To
* @param array $list An array of objects to sort.
Attachments (1)
Change History (5)
#1
follow-up:
↓ 2
@
6 years ago
- Focuses docs added
- Summary changed from wp_list_sort() wrong DocBlock tag defination to Doc: wp_list_sort() wrong DocBlock tag defination
- Type changed from defect (bug) to enhancement
- Version changed from 5.0.2 to 4.7
#2
in reply to:
↑ 1
@
6 years ago
@mukesh27 thank you for updating this.
I had contributed to v4.9.3 last time.
Note: See
TracTickets for help on using
tickets.
Hi @manikmist09, welcome to WordPress Trac! Thanks for the report.
Good cache. document added since 4.7