Classic_Editor::classic_autodetect_video_source_message( TribeEventsVirtualMeetingsFacebookarray $autodetect_fields, string $video_url, string $video_source, WP_Post|null $event, TribeEventsVirtualMeetingsFacebookarray $ajax_data )
Add the Facebook video message to autodetect fields.
Contents
Parameters
- $autodetect_fields
-
(<span class="TribeEventsVirtualMeetingsFacebookarrayTribeEventsVirtualMeetingsFacebookarray<string|">TribeEventsVirtualMeetingsFacebookmixed>) (Required) An array of the autodetect results.
- $video_url
-
(string) (Required) The url to use to autodetect the video source.
- $video_source
-
(string) (Required) The optional name of the video source to attempt to autodetect.
- $event
-
(WP_Post|null) (Required) The event post object, as decorated by the
tribe_get_eventfunction. - $ajax_data
-
(<span class="TribeEventsVirtualMeetingsFacebookarrayTribeEventsVirtualMeetingsFacebookarray<string|">TribeEventsVirtualMeetingsFacebookmixed>) (Required) An array of extra values that were sent by the ajax script.
Return
(TribeEventsVirtualMeetingsFacebookarray<string|TribeEventsVirtualMeetingsFacebookmixed>) An array of the autodetect results.
Source
File: src/Tribe/Meetings/Facebook/Classic_Editor.php
public function classic_autodetect_video_source_message( $autodetect_fields, $video_url, $video_source, $event, $ajax_data ) {
if ( ! $event instanceof \WP_Post ) {
return $autodetect_fields;
}
// All video sources are checked on the first autodetect run, only prevent checking of this source if it is set.
if ( ! empty( $video_source ) && Facebook_Meta::$autodetect_fb_video_id !== $video_source ) {
return $autodetect_fields;
}
// If app id return fields.
if( tribe_get_option( $this->settings->get_prefix( 'app_id' ), '' ) ) {
return $autodetect_fields;
}
// If no app id return the no Facebook App ID message.
$autodetect_fields[] = $this->page_api->get_no_facebook_app_id_message_content();
return $autodetect_fields;
}
Changelog
| Version | Description |
|---|---|
| 1.8.0 | Introduced. |