facetwp map marker click hook

djrmom

{{gist file=”custom-hooks.php” lang=”php”}}
<?php
/** hook to add JS on opening map markers **/
add_action( ‘wp_footer’, function() { ?>
<script>
(function($) {
if (‘object’ !== typeof FWP) {
return;
}

$(function() {
FWP.hooks.addAction(‘facetwp_map/marker/click’, function( marker ) {
// do stuff here
});
});
})(jQuery)
</script>
<?php }, 100 );
{{/gist}}