Abstract_Event_Meta::add_event_properties( WP_Post $event )
Adds API related properties to an event post object.
Contents
Parameters
- $event
-
(WP_Post) (Required) The event post object, as decorated by the
tribe_get_eventfunction.
Return
(WP_Post) The decorated event post object, with the API related properties added to it.
Source
File: src/Tribe/Integrations/Abstract_Event_Meta.php
public static function add_event_properties( WP_Post $event ) {
// Get the current actions
$current_action = tribe_get_request_var( 'action' );
// Return when the API is not the source and not running the create actions.
if ( static::$key_source_id !== $event->virtual_video_source && ! in_array( $current_action, static::$create_actions ) ) {
return $event;
}
$prefix = Virtual_Event_Meta::$prefix;
$is_new_event = empty( $event->ID );
$event = static::get_api_properties( $event, $prefix, $is_new_event );
$join_url = static::get_meeting_join_url( $event );
if ( ! empty( $join_url ) ) {
// An event that has an API integration assigned should be considered virtual.
$event->virtual = true;
$event->virtual_meeting = true;
$event->virtual_meeting_url = $join_url;
$event->virtual_meeting_provider = static::$key_source_id;
// Override the virtual url if no API details and linked button is checked.
if (
empty( $event->virtual_meeting_display_details )
&& ! empty( $event->virtual_linked_button )
) {
$event->virtual_url = $event->virtual_meeting_url;
} else {
// Set virtual url to null if an API is connected to the event.
$event->virtual_url = null;
}
}
return $event;
}
Changelog
| Version | Description |
|---|---|
| 1.11.0 | Introduced. |