facetwp set order of (or remove) flyout facets

djrmom

{{gist file=”custom-hooks.php” lang=”php”}}
<?php
add_action( ‘wp_head’, function() {
?>
<script>
(function($) {
if (‘object’ !== typeof FWP) {
return;
}
FWP.hooks.addFilter(‘facetwp/flyout/facets’, function(facets) {
return [‘facet3’, ‘facet1’, ‘facet2’]; // change the facet display order
});
})(jQuery);
</script>
<?php
}, 100 );
{{/gist}}{{gist file=”facet.js” lang=”javascript”}}
(function($) {
if (‘object’ !== typeof FWP) {
return;
}
FWP.hooks.addFilter(‘facetwp/flyout/facets’, function(facets) {
return [‘facet3’, ‘facet1’, ‘facet2’]; // change the facet display order
});

})(jQuery);
{{/gist}}