Skip to content

Instantly share code, notes, and snippets.

@jsakhil
Forked from strangerstudios/my_pmpro_email_data.php
Created October 30, 2020 14:50
Show Gist options
  • Save jsakhil/b9437f2749001ded7ed95df65262c6b0 to your computer and use it in GitHub Desktop.
Save jsakhil/b9437f2749001ded7ed95df65262c6b0 to your computer and use it in GitHub Desktop.
Add a !!todaysdate!! variable for use in Paid Memberships Pro email templates. Add this to your active theme's functions.php or a custom plugin and then include !!todaysdate!! in your email templates.
/*
Adds !!todaysdate!! as an available variable for use in Paid Memberships Pro emails.
Notice the array key does not include the !!s
*/
function my_pmpro_email_data($data, $email)
{
$data['todaysdate'] = date(get_option("date_format"));
return $data;
}
add_filter("pmpro_email_data", "my_pmpro_email_data", 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment