Created
January 17, 2017 16:25
-
-
Save markbiek/69a46d8d1ee7fc0906f77ee3461e5475 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
add_action('user_register', 'handle_user_register', 10, 1); | |
function handle_user_register($user_id) { | |
/* | |
* When a new user registers, write all POST values to user_meta. | |
* This way, they're accessible on when the new-user email is sent through wp_mail. | |
* Otherwise values like first & last name aren't accessible in the email | |
*/ | |
foreach ($_POST as $key => $val) { | |
update_user_meta($user_id, $key, $_POST[$key]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment