Skip to content

Instantly share code, notes, and snippets.

@mattiasghodsian
Last active April 28, 2023 08:34
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 mattiasghodsian/df6f66415933024d5be4cb76fafea8bc to your computer and use it in GitHub Desktop.
Save mattiasghodsian/df6f66415933024d5be4cb76fafea8bc to your computer and use it in GitHub Desktop.
[FacetWP] Set custom min/max value for Single Slider
/**
* Set custom min/max value for Single Slider in FacetWP (Replace ID-HERE)
*
* Donate a cup of coffee: https://www.buymeacoffee.com/mattiasghodsian
* Donate Eth: 0xBBB96204E45D11C9799c6B12E6eE6F0d4A071Ef5
**/
add_filter( 'facetwp_render_output', function( $output, $params ) {
if ( isset( $output['settings']['ID-HERE'] ) ) {
$output['settings']['ID-HERE']['range'] = [
'min' => [0],
'max' => [1500]
];
}
return $output;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment