Last active
February 21, 2020 18:25
-
-
Save bordoni/73e158e65c0768899c5b13dec2201f29 to your computer and use it in GitHub Desktop.
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_filter( 'tribe_events_ajax_response', function( $response ) { | |
if ( empty( $response['markers'] ) ) { | |
return $response; | |
} | |
foreach ( $response['markers'] as $index => $marker ) { | |
$zip = tribe_get_zip( $marker['event_id'] ); | |
if ( | |
empty( $marker['lat'] ) | |
&& empty( $marker['lng'] ) | |
&& empty( $zip ) | |
) { | |
unset( $response['markers'][ $index ] ); | |
} | |
} | |
return $response; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment