JetSmartFilters for JetEngine - how to change options and filters using php?
How to work with JetEngine filters in php:
You can change the options (labels, values etc):
function my_jet_filter_options( $options, $filter_id, $filter ){
if($filter_id == 123){
//do what you want with $options
}
return $options;
}
add_filter( 'jet-smart-filters/filters/filter-options', 'my_jet_filter_options',10,3 );
JetSmartFilters - Checkboxes List custom ordering
function my_jet_filter_options( $options, $filter_id, $filter ){
if($filter_id == 29320 || $filter_id == 29221 || $filter_id == 29321){
$sorted_category = wp_list_sort( $options, 'name', 'ASC' );
return $sorted_category;
}
}
add_filter( 'jet-smart-filters/filters/filter-options', 'my_jet_filter_options',10,3 );
for functions.php