Classic_Editor::render_meeting_generation_error_details( int|WP_Post $event = null, string $error_body = null, bool $echo = true )
Renders the error details shown to the user when a Zoom Meeting link generation fails.
Contents
Parameters
- $event
-
(int|WP_Post) (Optional) The event ID or object.
Default value: null
- $error_body
-
(string) (Optional) The error details in human-readable form. This can contain HTML tags (e.g. links).
Default value: null
- $echo
-
(bool) (Optional) Whether to echo the template to the page or not.
Default value: true
Return
(string) The rendered template contents.
Source
File: src/Tribe/Meetings/Zoom/Classic_Editor.php
public function render_meeting_generation_error_details( $event = null, $error_body = null, $echo = true ) {
$event = tribe_get_event( $event );
if ( ! $event instanceof \WP_Post ) {
return '';
}
$is_authorized = $this->api->is_ready();
$link_url = $is_authorized
? $this->url->to_generate_meeting_link( $event )
: Settings::admin_url();
$link_label = $is_authorized
? _x(
'Try again',
'The label of the button to try and generate a Zoom Meeting or Webinar link again.',
'events-virtual'
)
: $this->get_connect_to_zoom_label();
if ( null === $error_body ) {
$error_body = $this->get_unknown_error_message();
}
$error_body = wpautop( $error_body );
return $this->template->template(
'virtual-metabox/zoom/meeting-link-error-details',
[
'remove_link_url' => $this->get_remove_link( $event ),
'remove_link_label' => $this->get_remove_link_label(),
'is_authorized' => $is_authorized,
'error_body' => $error_body,
'link_url' => $link_url,
'link_label' => $link_label,
],
$echo
);
}
Changelog
| Version | Description |
|---|---|
| 1.0.0 | Introduced. |