Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
facetwp custom range and custom starting points for slider
<?php
/** set a custom range for a slider facet and set
** the start and end handles to the min/max of range instead of
** the min/max of the indexed data
**/
add_filter( 'facetwp_render_output', function( $output, $params ) {
if ( isset( $output['settings']['price'] ) ) {
$output['settings']['price']['range'] = array(
'min' => array( 0 ),
'max' => array( 40000 )
);
$output['settings']['price']['start'] = array( 0, 40000 );
}
return $output;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.