mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-02-27 11:12:50 +00:00
Docs: Add missing parameter and return descriptions to the DocBlocks for _wp_object_name_sort_cb() and _wp_object_count_sort_cb(), both uasort() callbacks.
See #32246. git-svn-id: https://develop.svn.wordpress.org/trunk@36013 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
96c5ced339
commit
fe89f7620f
@ -947,22 +947,33 @@ function wp_generate_tag_cloud( $tags, $args = '' ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for comparing objects based on name
|
||||
* Serves as a callback for comparing objects based on name.
|
||||
*
|
||||
* Used with `uasort()`.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access private
|
||||
* @return int
|
||||
*
|
||||
* @param object $a The first object to compare.
|
||||
* @param object $b The second object to compare.
|
||||
* @return int Negative number if `$a->name` is less than `$b->name`, zero if they are equal,
|
||||
* or greater than zero if `$a->name` is greater than `$b->name`.
|
||||
*/
|
||||
function _wp_object_name_sort_cb( $a, $b ) {
|
||||
return strnatcasecmp( $a->name, $b->name );
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for comparing objects based on count
|
||||
* Serves as a callback for comparing objects based on count.
|
||||
*
|
||||
* Used with `uasort()`.
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @access private
|
||||
* @return bool
|
||||
*
|
||||
* @param object $a The first object to compare.
|
||||
* @param object $b The second object to compare.
|
||||
* @return bool Whether the count value for `$a` is greater than the count value for `$b`.
|
||||
*/
|
||||
function _wp_object_count_sort_cb( $a, $b ) {
|
||||
return ( $a->count > $b->count );
|
||||
|
||||
Loading…
Reference in New Issue
Block a user