Event_Meta::add_event_properties( WP_Post $event )
Adds Facebook 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 Facebook related properties added to it.
Source
File: src/Tribe/Meetings/Facebook/Event_Meta.php
public static function add_event_properties( \WP_Post $event ) {
// Return when Facebook is not the source.
if ( 'facebook' !== $event->virtual_video_source ) {
return $event;
}
// Get the saved values since the source is Facebook.
foreach ( self::$fields as $field_name ) {
$prefix_name = self::get_prefix( $field_name );
$value = self::get_meta_field( $prefix_name, $event );
$event->{$prefix_name} = $value;
}
// Enforce this is a virtual event.
$event->virtual = true;
$event->virtual_meeting = true;
$event->virtual_meeting_provider = tribe( Facebook_Provider::class )->get_slug();
// Set virtual url to null if Facebook is connected to the event.
$event->virtual_url = null;
return $event;
}
Changelog
| Version | Description |
|---|---|
| 1.7.0 | Introduced. |