Last active
August 4, 2022 08:56
-
-
Save digamber89/2ffe57504909526b5ecb0b6d26396fd3 to your computer and use it in GitHub Desktop.
Zoom WooCommerce Appointments - Show Join via Browser only
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 | |
function cm_220801_modified_gcal_sync( $data, $appointment ) { | |
remove_filter( 'woocommerce_appointments_gcal_sync', 'cm_220801_modified_gcal_sync' ); | |
$data = ''; | |
$appointment_id = $appointment->get_id(); | |
$meeting_details = get_post_meta( $appointment_id, '_vczapi_woocommerce_appointments_meeting_details', true ); | |
if ( ! empty( $meeting_details ) ) { | |
$meeting = json_decode( $meeting_details ); | |
if ( is_object( $meeting ) ) { | |
$pwd = ! empty( $meeting->password ) ? $meeting->password : false; | |
$data['description'] .= __( 'Join Zoom Meeting ', 'vczapi-woocommerce-appointments' ) . | |
html_entity_decode( \Codemanas\ZoomWooCommerceAppointments\Main\DataStore::get_browser_join_link( $meeting->id, $pwd ) ) . PHP_EOL; | |
} | |
} | |
return $data; | |
} | |
add_filter( 'woocommerce_appointments_gcal_sync', 'cm_220801_modified_gcal_sync' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment