Created
August 10, 2020 18:56
-
-
Save dparker1005/e01653e52cc1587e612c18a6c6a4cdc4 to your computer and use it in GitHub Desktop.
Adds variable !!edit_user!! to email templates to link to edit user page.
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 | |
// Copy from below here... | |
/* | |
* Adds variable !!edit_user!! to email templates to link to edit user page. | |
*/ | |
function my_pmpro_email_data_add_edit_user($data, $email) { | |
$user = get_user_by( 'email', $data['user_email'] ); | |
$edit_user_page = 'http://yoursite.com/wp-admin/user-edit.php?user_id=' . $user->ID; | |
$data['edit_user'] = '<a href="' . $edit_user_page . '">' . $edit_user_page . '</a>'; | |
return $data; | |
} | |
add_filter("pmpro_email_data", "my_pmpro_email_data_add_edit_user", 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment