Created
October 23, 2020 14:10
-
-
Save mgibbs189/3a50530f778c91b29d72de0b32a0e065 to your computer and use it in GitHub Desktop.
FacetWP - ignore URL hash except when resetting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
(function($) { | |
$(document).on('facetwp-refresh', function() { | |
if (! FWP.loaded) { | |
FWP.temp_set_hash = FWP.set_hash; // on init, save a backup of FWP.set_hash() | |
} | |
if (FWP.is_reset) { | |
FWP.set_hash = FWP.temp_set_hash; // on reset, store FWP.set_hash() | |
} | |
else { | |
FWP.set_hash = function() { /* empty */ } // otherwise, empty it | |
} | |
}); | |
})(jQuery); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment