tribe_embed_google_map( int $post_id = null )
Check if the “Show Map” option is enabled for the event or venue.
Contents
Parameters
- $post_id
-
(int) (Optional) The Post ID. If none specified, current post is used.
Default value: null
Return
(bool) True if the "Show Map" option is enabled.
Source
File: src/functions/template-tags/google-map.php
function tribe_embed_google_map( $postId = null ) {
$output = false;
$postId = Tribe__Events__Main::postIdHelper( $postId );
$post_type = get_post_type( $postId );
if ( tribe_get_option( 'embedGoogleMaps', true ) ) {
if ( $post_type == Tribe__Events__Main::POSTTYPE ) {
$output = tribe_is_truthy( get_post_meta( $postId, '_EventShowMap', 1 ) );
} elseif ( $post_type == Tribe__Events__Main::VENUE_POST_TYPE ) {
$output = tribe_is_truthy( get_post_meta( $postId, '_VenueShowMap', 1 ) );
}
}
return apply_filters( 'tribe_embed_google_map', $output );
}