Google_Calendar::generate_string_address( int|WP_Post|null $event = null )
Returns a string version of the full address of an event.
Contents
See also
- Tribe__Events__Main->fullAddressString()
Parameters
- $event
-
(int|WP_Post|null) (Optional) The post object or post id.
Default value: null
Return
(string) The event venue's address. Empty string if the event or venue isn't found.
Source
File: src/Tribe/Views/V2/iCalendar/Links/Google_Calendar.php
public static function generate_string_address( $event = null ) {
if ( empty( $event ) ) {
$event = get_the_ID();
}
$event = tribe_get_event( $event );
// Not an event? Bail.
if ( ! tribe_is_event( $event ) ) {
return '';
}
if ( ! tribe_has_venue( $event ) ) {
return '';
}
$tec = Tribe__Events__Main::instance();
$address = $tec->fullAddressString( $event );
// The above includes the venue name.
return $address;
}
Changelog
| Version | Description |
|---|---|
| 5.14.0 | Introduced. |