facetwp fit_bounds

djrmom

{{gist file=”custom-hooks.php” lang=”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( fit_bounds ) {
if ( FWP.loaded ) {
return fit_bounds;
} else {
return false;
}
});
}
});
})(jQuery);
</script>
<?php
}, 100);
{{/gist}}