Skip to content

Commit

Permalink
Fix a PHP 8 deprecation warning in category-template.php uasort()
Browse files Browse the repository at this point in the history
… helper.

Props Webrocker, jigar-bhanushali, jrf, audrasjb, costdev.
Fixes #57358.
See #56790.


git-svn-id: https://develop.svn.wordpress.org/trunk@55214 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
audrasjb committed Feb 3, 2023
1 parent bd4d4af commit b7db42f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wp-includes/category-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -1084,10 +1084,10 @@ function _wp_object_name_sort_cb( $a, $b ) {
*
* @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`.
* @return int The count value for `$a` minus the count value for `$b` (less than, equal to, or greater than zero).
*/
function _wp_object_count_sort_cb( $a, $b ) {
return ( $a->count > $b->count );
return ( $a->count - $b->count );
}

//
Expand Down

0 comments on commit b7db42f

Please sign in to comment.