Tribe__Events__Main::fullAddressString( $postId = null )
Returns a string version of the full address of an event
Contents
Parameters
-
(int|WP_Post) (Required) The post object or post id.
Return
(string) The event's address.
Source
File: src/Tribe/Main.php
public function fullAddressString( $postId = null ) {
$address = '';
if ( tribe_get_venue( $postId ) ) {
$address .= tribe_get_venue( $postId );
}
if ( tribe_get_address( $postId ) ) {
if ( $address != '' ) {
$address .= ', ';
}
$address .= tribe_get_address( $postId );
}
if ( tribe_get_city( $postId ) ) {
if ( $address != '' ) {
$address .= ', ';
}
$address .= tribe_get_city( $postId );
}
if ( tribe_get_region( $postId ) ) {
if ( $address != '' ) {
$address .= ', ';
}
$address .= tribe_get_region( $postId );
}
if ( tribe_get_zip( $postId ) ) {
if ( $address != '' ) {
$address .= ', ';
}
$address .= tribe_get_zip( $postId );
}
if ( tribe_get_country( $postId ) ) {
if ( $address != '' ) {
$address .= ', ';
}
$address .= tribe_get_country( $postId );
}
return $address;
}