Created
February 1, 2023 15:44
-
-
Save dwanjuki/28a98311443edd3b2a96e94065cd1333 to your computer and use it in GitHub Desktop.
This recipe makes the !!renewaldate!! variable available for use in all Paid Memberships Pro emails.
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 | |
/** | |
* This recipe makes the !!renewaldate!! variable available for use in all Paid Memberships Pro emails. | |
* When the variable is empty it will display nothing instead of the !!renewaldate!! email variable | |
* | |
* Notice the array key does not include the !!s | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_email_renewaldate_data( $data ) { | |
$data['renewaldate'] = date( get_option( "date_format" ), pmpro_next_payment() ); | |
return $data; | |
} | |
add_filter( 'pmpro_email_data', 'my_pmpro_email_renewaldate_data', 10 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment