Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Last active May 28, 2020 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgibbs189/8ceba26323b6bf4fe37d18b5b28575cd to your computer and use it in GitHub Desktop.
Save mgibbs189/8ceba26323b6bf4fe37d18b5b28575cd to your computer and use it in GitHub Desktop.
FacetWP - Map facet - turn off bounds
<?php
// Add to your (child) theme's functions.php
add_action( 'wp_head', function() {
?>
<script>
(function($) {
$(function() {
if ( 'undefined' !== typeof FWP && 'undefined' !== typeof FWP.hooks) {
FWP.hooks.addFilter('facetwp_map/fit_bounds', function(bool) {
return FWP.loaded; // force a default only for initial pageload
});
}
});
})(jQuery);
</script>
<?php
}, 100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment