FacetWP – set pre-selected facet choices data in the URL

<script>
(function($) {
    $(document).on('facetwp-loaded', function() {
        if (! FWP.loaded) {
            FWP.parse_facets(); // parse the DOM to get the facet selections
            FWP.set_hash(); // update the URL bar
        }
     });
})(jQuery);
</script>