FacetWP – show hidden facet options if a value is selected

mgibbs189

{{gist file=”test.js” lang=”javascript”}}
(function($) {
$(document).on(‘facetwp-loaded’, function() {
$.each(FWP.facets, function(facet, value) {
if (FWP.facets[facet].length > 0) {
$(‘.facetwp-facet-‘+facet+’ .facetwp-toggle:first’).click();
}
});
});
})(jQuery);
{{/gist}}