Created
July 20, 2020 07:43
-
-
Save andrewlimaza/ae5ec6383d4c9bff63a74af184231dea to your computer and use it in GitHub Desktop.
Add !!user_id!! to 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 | |
/** | |
* Add's !!user_id!! variable to all Paid Memberships Pro emails. | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_email_data_example( $data, $email ) { | |
$user = get_user_by( "login", $data['user_login'] ); | |
$data['user_id'] = $user->ID; //adjust 'user_id' for the variable you want to use instead. | |
return $data; | |
} | |
add_filter( "pmpro_email_data", "my_pmpro_email_data_example", 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment