Created
March 22, 2016 10:43
-
-
Save Pebblo/0f6c5fdcd31f572c7bf1 to your computer and use it in GitHub Desktop.
This plugin can be used to add custom shortcodes to the EE3 confirmation emails. Currently it adds the [reg_date] shortcode which parses to the date and time that the user laced the registration.
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: Event Espresso site specific functions | |
Description: Add custom functions for Event Espresso to this plugin. | |
/* Begin Adding Functions Below This Line; Do not include an opening PHP tag as this sample code already includes one! */ | |
//Add a custom shortcode for use within the emails. | |
function espresso_custom_email_shortcode( $shortcodes ) { | |
$shortcodes[] = "[reg_date]"; | |
return $shortcodes; | |
} | |
add_filter('filter_hook_espresso_post_replace_shortcode_search_values', 'espresso_custom_email_shortcode'); | |
//Add the value for the custom shortcode we just added above. | |
function espresso_custom_email_shortcode_value( $shortcode_values, $data ) { | |
$shortcode_values[] = $data->attendee->date; | |
return $shortcode_values; | |
} | |
add_filter('filter_hook_espresso_post_replace_shortcode_replace_values', 'espresso_custom_email_shortcode_value', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment