Skip to content

Instantly share code, notes, and snippets.

@bordoni
Last active February 21, 2020 18:25
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 bordoni/73e158e65c0768899c5b13dec2201f29 to your computer and use it in GitHub Desktop.
Save bordoni/73e158e65c0768899c5b13dec2201f29 to your computer and use it in GitHub Desktop.
<?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