<?php
/**
* Set {n} selected text to show after 1 selection, on all facets
*/
function td_facetwp_selected() {
if ( is_tax() ) {
?>
<script>
(function($) {
$(function() {
if ('undefined' !== typeof FWP) {
wp.hooks.addFilter('facetwp/set_options/fselect', function(opts, data) {
opts.numDisplayed = 1;
return opts;
});
}
});
})(jQuery);
</script>
<?php
}
}
add_filter( 'wp_head', 'td_facetwp_selected', 100 );