Created
January 16, 2019 09:21
-
-
Save wpmudev-sls/e899d2bd85bb8dd02ce1934ff9111639 to your computer and use it in GitHub Desktop.
Appointment - GOOGLE_CALENDAR_LINK custom placeholder
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 | |
/** | |
* Plugin Name: Appointment - GOOGLE_CALENDAR_LINK custom placeholder | |
* Description: Appointment - GOOGLE_CALENDAR_LINK custom placeholder | |
* Author: Ariful Islam @ WPMUDEV | |
* Author URI: https://premium.wpmudev.org/profile/itsarifulislam | |
* License: GPLv2 or later | |
*/ | |
add_filter( 'appointments_notification_replacements', function( $replacement, $notification_type, $text, $r ) { | |
global $appointments; | |
$gcal_link = esc_url_raw( $appointments->gcal( $r->service, strtotime( $r->start, $appointments->local_time ), strtotime( $r->end, $appointments->local_time ), true, $r->address, $r->city ) ); | |
$other_replacement = array( | |
'/\bGOOGLE_CALENDAR_LINK\b/U' => $gcal_link | |
); | |
return $replacement = array_merge( $replacement, $other_replacement ); | |
}, 10, 4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment