Last active
December 10, 2019 04:40
-
-
Save techies23/f3a75f33e586ccd4389ad3b8967e9f54 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Renaming join link table rendered via shortcode | |
* | |
*/ | |
remove_action('vczoom_meeting_before_shortcode', 'video_conference_zoom_shortcode_table', 10); | |
add_action( 'vczoom_meeting_before_shortcode', 'video_conference_zoom_shortcode', 10 ); | |
function video_conference_zoom_shortcode( $zoom_meetings ) { | |
?> | |
<table> | |
<tr> | |
<td>Meeting ID</td> | |
<td><?php echo $zoom_meetings->id; ?></td> | |
</tr> | |
<tr> | |
<td>Topic</td> | |
<td><?php echo $zoom_meetings->topic; ?></td> | |
</tr> | |
<tr> | |
<td>Meeting Status</td> | |
<td> | |
<?php echo $zoom_meetings->status; ?> | |
<p class="small-description">Refresh is needed to change status.</p> | |
</td> | |
</tr> | |
<tr> | |
<td>Start Time</td> | |
<td><?php echo vczapi_dateConverter( $zoom_meetings->start_time, $zoom_meetings->timezone, 'F j, Y @ g:i a' );; ?></td> | |
</tr> | |
<tr> | |
<td>Timezone</td> | |
<td><?php echo $zoom_meetings->timezone; ?></td> | |
</tr> | |
<tr> | |
<td>Duration</td> | |
<td><?php echo $zoom_meetings->duration; ?></td> | |
</tr> | |
<?php | |
/** | |
* Hook: vczoom_meeting_shortcode_join_links | |
* | |
* @video_conference_zoom_shortcode_join_link - 10 | |
* | |
*/ | |
do_action( 'vczoom_meeting_shortcode_join_links', $zoom_meetings ); | |
?> | |
</table> | |
<?php | |
} | |
remove_action('vczoom_meeting_shortcode_join_links', 'video_conference_zoom_shortcode_join_link', 10); | |
add_action( 'vczoom_meeting_shortcode_join_links', 'video_conference_zoom_shortcode_join_link_theme', 10 ); | |
function video_conference_zoom_shortcode_join_link_theme($zoom_meetings) { | |
global $vanity_uri; | |
/** | |
* @TO-DO | |
* 1. Sometimes zoom does not produce https://zoom.us/j uri by default | |
*/ | |
if ( ! empty( $vanity_uri ) ) { | |
$browser_url = trailingslashit( $vanity_uri . 'wc/join/' . $zoom_meetings->id ); | |
$join_uri = trailingslashit( $vanity_uri . '/j/' . $zoom_meetings->id ); | |
} else { | |
$browser_url = 'https://zoom.us/wc/join/' . $zoom_meetings->id; | |
$join_uri = 'https://zoom.us/j/' . $zoom_meetings->id; | |
} | |
$params['timezone'] = $zoom_meetings->timezone; | |
$params['start_date'] = vczapi_dateConverter( $zoom_meetings->start_time, $zoom_meetings->timezone, 'Y-m-d\TH:i:s\Z' ); | |
if ( ! video_conference_zoom_meeting_check_valid_meeting( $params ) ) { | |
?> | |
<tr> | |
<td colspan="2" class="dpn-zvc-mtglink-no-valid"><?php echo apply_filters( 'vczoom_shortcode_link_not_valid_anymore', __( 'This meeting is no longer valid and cannot be joined !', 'video-conferencing-with-zoom-api' ) ); ?></td> | |
</tr> | |
<?php } else { ?> | |
<tr> | |
<td><?php _e( 'Join via Zoom App', 'video-conferencing-with-zoom-api' ); ?></td> | |
<td><a class="btn-join-link-shortcode" href="<?php echo $join_uri; ?>" title="<?php echo $zoom_meetings->topic; ?>"><?php _e( 'Join', 'video-conferencing-with-zoom-api' ); ?></a></td> | |
</tr> | |
<tr> | |
<td><?php _e( 'Join via Web Browser', 'video-conferencing-with-zoom-api' ); ?></td> | |
<td><a class="btn-join-link-shortcode" href="<?php echo $browser_url; ?>" title="<?php echo $zoom_meetings->topic; ?>"><?php _e( 'Join', 'video-conferencing-with-zoom-api' ); ?></a></td> | |
</tr> | |
<?php | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment