[wp-trac] [WordPress Trac] #45766: wp_list_sort() wrong DocBlock tag defination
WordPress Trac
noreply at wordpress.org
Tue Dec 25 17:37:42 UTC 2018
#45766: wp_list_sort() wrong DocBlock tag defination
--------------------------+-----------------------------
Reporter: manikmist09 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 5.0.2
Severity: normal | Keywords: has-patch
Focuses: |
--------------------------+-----------------------------
`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.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/45766>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list