FacetWP – order by display value numerically

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?php

// Add the following to your (child) theme’s functions.php

add_filter( ‘facetwp_facet_orderby’, function( $orderby, $facet ) {
if ( ‘size_women’ == $facet[‘name’] ) {
$orderby = ‘f.facet_display_value+0 ASC’;
}
return $orderby;
}, 10, 2 );

{{/gist}}