Skip to content

Instantly share code, notes, and snippets.

@djrmom
Created October 28, 2020 17:47
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 djrmom/c775aa68c19535330554a837ee062d97 to your computer and use it in GitHub Desktop.
Save djrmom/c775aa68c19535330554a837ee062d97 to your computer and use it in GitHub Desktop.
facetwp fit_bounds
add_action( 'wp_head', function() {
?>
<script>
(function($) {
$(function() {
if ( 'undefined' !== typeof FWP && 'undefined' !== typeof FWP.hooks) {
FWP.hooks.addFilter('facetwp_map/fit_bounds', function( fit_bounds ) {
if ( FWP.loaded ) {
return fit_bounds;
} else {
return false;
}
});
}
});
})(jQuery);
</script>
<?php
}, 100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment