Last active
May 28, 2025 13:52
-
-
Save LaxusCroco/a748352207c3e08ac2187c16e4dfd980 to your computer and use it in GitHub Desktop.
Replace 1305 with the filter ID
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'jet-smart-filters/filters/filter-options', function( $options, $filter_id ){ | |
if ( 1305 == $filter_id ) { | |
uasort( $options, '__compare_jsf' ); | |
} | |
return $options; | |
}, 0, 2 ); | |
function __compare_jsf( $a, $b ) { | |
$a = (int) $a; | |
$b = (int) $b; | |
if ( $a >= $b ) { | |
$c = 1; | |
} else { | |
$c = -1; | |
} | |
return $c; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment