Skip to content

Instantly share code, notes, and snippets.

@dparker1005
Created August 10, 2020 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dparker1005/e01653e52cc1587e612c18a6c6a4cdc4 to your computer and use it in GitHub Desktop.
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.
<?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