Last active
October 11, 2018 12:44
-
-
Save mgibbs189/e96b8a4b70f810ce6b73 to your computer and use it in GitHub Desktop.
FacetWP - set default slider "start" values
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 | |
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 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment