facetwp – click event to reset individual facet

mgibbs189

{{gist file=”facet.js” lang=”javascript”}}
(function($) {
$(document).on(‘click’, ‘#reset’, function() {
FWP.is_reset = true;
FWP.facets[‘my_facet’] = []; // set facet to no selections
delete FWP.facets[‘paged’]; // remove “paged” from URL
FWP.refresh();
});
})(jQuery);

{{/gist}}