facetwp set order of (or remove) flyout facets

mgibbs189

{{gist file=”facet.js” lang=”javascript”}}
<?php

// Add to your (child) theme’s functions.php, or into the Custom Hooks plugin!

add_action( ‘wp_head’, function() {
?>
<script>
(function($) {

FWP.hooks.addFilter(‘facetwp/flyout/facets’, function(facets) {
return [‘facet3’, ‘facet1’, ‘facet2’]; // change the facet display order
});

})(jQuery);
</script>
<?php
}, 100 );

{{/gist}}