Skip to content

Commit

Permalink
Avoid a PHP8 deprecation notice when using uksort()
Browse files Browse the repository at this point in the history
Fixes #6
  • Loading branch information
imath authored Dec 10, 2023
1 parent 12be0ac commit bcf330e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions inc/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@
*
* @param string $a The BuddyPress version to compare.
* @param string $b The BuddyPress version to compare with.
* @return boolean True if $a < $b.
* @return integer 1 if $a < $b, -1 otherwise.
*/
function bp_beta_tester_sort_versions( $a, $b ) {
return version_compare( $a, $b, '<' );
$is_lower = -1;
if ( version_compare( $a, $b, '<' ) ) {
$is_lower = 1;
}

return $is_lower;
}

/**
Expand Down

0 comments on commit bcf330e

Please sign in to comment.