Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Created July 21, 2015 19:57
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 mgibbs189/33920b8e144bd518acfe to your computer and use it in GitHub Desktop.
Save mgibbs189/33920b8e144bd518acfe to your computer and use it in GitHub Desktop.
FacetWP - custom slider step sizes
<?php
function custom_slider_steps( $output, $params ) {
$output['settings']['YOUR_SLIDER_FACET_NAME']['range'] = array(
'min' => array( 0.001 ),
'25%' => array( 0.01, 0.01 ),
'50%' => array( 1, 1 ),
'75%' => array( 100, 100 ),
'max' => array( 250000 )
);
return $output;
}
add_filter( 'facetwp_render_output', 'custom_slider_steps', 10, 2 );
@loge99
Copy link

loge99 commented May 3, 2020

Hi,
first of all, thank you for posting this code! :)
I tried to add it to the custom hook plugin, but still it doesn't show any changes in my slider facet.
['YOUR_SLIDER_FACET_NAME'] > I added the label of my slider here.

Do you have any idea? I added screenshots to show what I did.

Thank you,
Lorenzo
Screenshot (99)
Screenshot (98)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment