facetwp modify slider label

djrmom

{{gist file=”custom-hooks.php” lang=”php”}}
<php
/** add js to wp_head to modify slider **/

add_action( ‘wp_head’, function() { ?>
<script>
(function($) {
$(function() {
FWP.hooks.addAction(‘facetwp/set_label/slider’, function($this) {
var label = $this.find(‘.facetwp-slider-label’).html();
var regex = /(^[^s]+)/;
label = label.replace(regex,”<span class=”slider-min”>$1</span>”);
$this.find(‘.facetwp-slider-label’).html(label);
});
});
})(jQuery);
</script>
<?php }, 100);
{{/gist}}