Last active
May 28, 2020 13:53
-
-
Save mgibbs189/8ceba26323b6bf4fe37d18b5b28575cd to your computer and use it in GitHub Desktop.
FacetWP - Map facet - turn off bounds
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
<?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