Created
October 22, 2018 19:56
-
-
Save djrmom/571ae826a7f8d69bea4933be16e39032 to your computer and use it in GitHub Desktop.
facetwp custom range and custom starting points for slider
This file contains 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 | |
/** 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