Classic_Editor::get_link_creation_urls( WP_Post $post, bool $webinar_support = false )
Returns the meeting/webinar creation links and labels.
Contents
Parameters
- $post
-
(WP_Post) (Required) The post object of the Event context of the link creation.
- $webinar_support
-
(bool) (Optional) Whether to add the webinar create link.
Default value: false
Return
(TribeEventsVirtualMeetingsZoomarray<string,array<string>>) A map (by meeting type) of unpackable arrays, each one containing the URL and label for the creation link HTML code.
Source
File: src/Tribe/Meetings/Zoom/Classic_Editor.php
public function get_link_creation_urls( \WP_Post $post, $webinar_support = false ) {
$meeting_create_label = _x(
'Meeting',
'Label for the control to generate a Zoom meeting link in the event classic editor UI.',
'events-virtual'
);
$webinar_create_label = _x(
'Webinar',
'Label for the control to generate a Zoom webinar link in the event classic editor UI.',
'events-virtual'
);
$data = [
Meetings::$meeting_type => [
$this->url->to_generate_meeting_link( $post ),
$meeting_create_label,
false,
[],
]
];
$webinar_tooltip = [
'classes_wrap' => [ 'tec-events-virtual-meetings-zoom__type-options--tooltip' ],
'message' => _x(
'Webinars are not enabled for this host. Webinar support is enabled by the account plan in Zoom.',
'Explains why the webinar field is disabled when creating a meeting/webinar for an event.',
'events-virtual'
),
];
// Add webinar, but disable by default
$data[ Webinars::$meeting_type ] = [
$this->url->to_generate_webinar_link( $post ),
$webinar_create_label,
// Webinar Disabled, set to true if disabled.
$webinar_support || $this->api->supports_webinars() ? false : true,
// Add Tooltip.
$webinar_support || $this->api->supports_webinars() ? [] : $webinar_tooltip,
];
/**
* Allows filtering the creation links URL and label before rendering them on the admin UI.
*
* @since 1.8.2
*
* @param array<string,array<string>> A map (by meeting type) of unpackable arrays, each one containing the URL and
* label for the creation link HTML code.
* @param \WP_Post $post The post object of the Event context of the link creation.
*/
return apply_filters( 'tec_events_virtual_zoom_meeting_link_creation_urls', $data, $post );
}
Changelog
| Version | Description |
|---|---|
| 1.8.2 | Introduced. |