facetwp get value of facet filter

djrmom

{{gist file=”scripts.js” lang=”javascript”}}
(function($) {
$(document).on(‘facetwp-loaded’, function() {
if (‘undefined’ !== typeof FWP.facets[‘facet_name’] ) {
if ( $.inArray( ‘some_value’, FWP.facets[‘facet_name’] ) > -1 ) {
// update form value as needed in gravity form
}
}
});
})(jQuery);
{{/gist}}