tribe_get_coordinates( int $postId = null )

Returns the coordinates of the venue


Parameters

$postId

(int) (Optional) Either event id or venue id, if none specified, current post is used.

Default value: null


Top ↑

Return

(array) An Array with the Latitude and Longitude of the venue.


Top ↑

Source

File: src/functions/template-tags/venue.php

	function tribe_get_coordinates( $postId = null ) {
		$venue_id = tribe_get_venue_id( $postId );

		if ( class_exists( 'Tribe__Events__Pro__Geo_Loc' ) ) {
			$output[ 'lat' ] = (float) get_post_meta( $venue_id, Tribe__Events__Pro__Geo_Loc::LAT, true );
			$output[ 'lng' ] = (float) get_post_meta( $venue_id, Tribe__Events__Pro__Geo_Loc::LNG, true );
		} else {
			$output = array(
				'lat' => 0,
				'lng' => 0,
			);
		}

		/**
		 * Allows customization of a venue's coordinates.
		 *
		 * @since ??
		 * @since 4.5.11 Added docblock and venue ID to filter
		 *
		 * @param array $output The latitute and longitude of the venue.
		 * @param int $venue_id The venue ID
		 */
		return apply_filters( 'tribe_get_coordinates', $output, $venue_id );
	}

Top ↑

Changelog

Changelog
Version Description
?? Introduced.