Password::get_zoom_meeting_link( WP_Post $event, bool $is_email = false )
Get the Zoom meeting link, with or without the password hash.
Contents
Parameters
- $event
-
(WP_Post) (Required) The event post object, as decorated by the
tribe_get_eventfunction. - $is_email
-
(bool) (Optional) Whether to skip the filters and return the full join url with password.
Default value: false
Return
(string) The Zoom meeting join url.
Source
File: src/Tribe/Meetings/Zoom/Password.php
public function get_zoom_meeting_link( \WP_Post $event, $is_email = false ) {
/*
* If the ID is empty, return a blank string to prevent remove_query_arg() using current URL.
*
* This happens because get_post_meta() will always return false when the ID is empty.
*/
if ( empty( $event->ID ) ) {
return '';
}
$prefix = Virtual_Event_Meta::$prefix;
$zoom_join_url = get_post_meta( $event->ID, $prefix . 'zoom_join_url', true );
// If is_email always return the full link with password.
if ( $is_email ) {
return $zoom_join_url;
}
/**
* Filters the Zoom meeting link show with the password for all site visitors.
*
* @since 1.0.2
*
* @param boolean $include_password Whether a user is logged in.
* @param \WP_Post $event The event post object, as decorated by the `tribe_get_event` function.
*/
$include_password = apply_filters( 'tribe_events_virtual_meetings_zoom_meeting_include_password', is_user_logged_in(), $event );
if ( $include_password ) {
return $zoom_join_url;
}
// Remove the Query Strings.
$zoom_join_url = remove_query_arg( 'pwd', $zoom_join_url );
return $zoom_join_url;
}
Changelog
| Version | Description |
|---|---|
| 1.0.2 | Introduced. |