From b7db42f94e21406c223a040e784a10b163d343a7 Mon Sep 17 00:00:00 2001 From: Jb Audras Date: Fri, 3 Feb 2023 15:42:11 +0000 Subject: [PATCH] Fix a PHP 8 deprecation warning in `category-template.php` `uasort()` 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 --- src/wp-includes/category-template.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/category-template.php b/src/wp-includes/category-template.php index b35c17170d..969ea9c67c 100644 --- a/src/wp-includes/category-template.php +++ b/src/wp-includes/category-template.php @@ -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 ); } //