Last active
January 31, 2016 23:55
-
-
Save jondcampbell/d7682fcf68ecd7a48bd1 to your computer and use it in GitHub Desktop.
Theme my login replacement variables filter. Used to add your own variables to the Custom Emails module of theme my login. Uses tml_replace_vars.
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
function custom_email_replace($old_replacements, $user_id){ | |
// Generate the new url we need for this user | |
$enrollment_form_url = 'special-url-'.$user_id; | |
// An array of our replacement variables and their values | |
$new_replacements = array( | |
'%enrollmentform%'=> $enrollment_form_url, | |
); | |
// Merge our two arrays together | |
$replacements = array_merge($old_replacements, $new_replacements); | |
// Return the array of all the replacements | |
return $replacements; | |
} | |
add_filter( 'tml_replace_vars', 'custom_email_replace', 99, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment