tribe_get_venue_details( int|null $post_id = null )
Gets venue details for use in some single-event templates.
Contents
Parameters
- $post_id
-
(int|null) (Optional) The venue ID.
Default value: null
Return
(array) The venue name and venue address.
Source
File: src/functions/template-tags/venue.php
function tribe_get_venue_details( $post_id = null ) {
$post_id = Tribe__Main::post_id_helper( $post_id );
if ( ! $post_id ) {
return array();
}
$venue_details = array();
if ( $venue_link = tribe_get_venue_link( $post_id ) ) {
$venue_details['linked_name'] = $venue_link;
}
if ( $venue_address = tribe_get_full_address( $post_id ) ) {
$venue_details['address'] = $venue_address;
}
/**
* Allows customization of the retrieved venue details.
*
* @since ??
* @since 4.5.11 Added docblock and venue ID to filter.
*
* @param array $venue_details An array of the venue's details
* @param int $post_id The venue ID
*/
return apply_filters( 'tribe_get_venue_details', $venue_details, $post_id );
}
Changelog
| Version | Description |
|---|---|
| ?? | Introduced. |