tribe_show_google_map_link( int $post_id = null )
Check if the “Show Map Link” 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 Link" option is enabled.
Source
File: src/functions/template-tags/google-map.php
function tribe_show_google_map_link( $postId = null ) {
$output = false;
$postId = Tribe__Events__Main::postIdHelper( $postId );
$post_type = get_post_type( $postId );
if ( $post_type == Tribe__Events__Main::POSTTYPE ) {
$output = tribe_is_truthy( get_post_meta( $postId, '_EventShowMapLink', 1 ) );
} elseif ( $post_type == Tribe__Events__Main::VENUE_POST_TYPE ) {
$output = tribe_is_truthy( get_post_meta( $postId, '_VenueShowMapLink', 1 ) );
}
return apply_filters( 'tribe_show_google_map_link', $output );
}
Changelog
| Version | Description |
|---|---|
| 4.6.24 | Introduced. |