Event_Meta::get_password( WP_Post $event )
Get the Webex password if it should be shown.
Contents
Parameters
- $event
-
(WP_Post) (Required) The event post object, as decorated by the
tribe_get_eventfunction.
Return
(string|null) The password or null if it should not be shown.
Source
File: src/Tribe/Meetings/Webex/Event_Meta.php
public static function get_password( \WP_Post $event ) {
$should_show = static::should_show_password( $event );
/**
* Filters whether the Webex password should be shown.
*
* @since 1.9.0
*
* @param boolean $should_show Whether the password should be shown.
* @param WP_Post $event The event post object, as decorated by the `tribe_get_event` function.
*/
$should_show = apply_filters( 'tec_events_virtual_meetings_webex_meeting_show_password', $should_show, $event );
if ( ! $should_show ) {
return null;
}
$prefix = Virtual_Event_Meta::$prefix;
$password = get_post_meta( $event->ID, $prefix . 'webex_password', true );
if ( $password ) {
return $password;
}
$all_webex_details = get_post_meta( $event->ID, $prefix . 'webex_meeting_data', true );
return Arr::get( $all_webex_details, 'password', null );
}
Changelog
| Version | Description |
|---|---|
| 1.9.0 | Introduced. |