Skip to content

Instantly share code, notes, and snippets.

@djrmom
Created October 22, 2018 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djrmom/571ae826a7f8d69bea4933be16e39032 to your computer and use it in GitHub Desktop.
Save djrmom/571ae826a7f8d69bea4933be16e39032 to your computer and use it in GitHub Desktop.
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