FacetWP – set default slider “start” values

mgibbs189

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

function my_facetwp_render_output( $output, $params ) {
$facet_name = ‘YOUR_FACET_NAME’; // CHANGE ME

foreach ( $params[‘facets’] as $facet ) {
if ( $facet_name == $facet[‘facet_name’] && empty( $facet[‘selected_values’] ) ) {
$output[‘settings’][ $facet_name ][‘start’] = array( 10, 50 );
}
}
return $output;
}
add_filter( ‘facetwp_render_output’, ‘my_facetwp_render_output’, 10, 2 );
{{/gist}}