Is there an add_filter
where you can see/modify all the $_POST
data submitted for a new user registration before the user is created?
Thanks
Is there an add_filter
where you can see/modify all the $_POST
data submitted for a new user registration before the user is created?
Thanks
Well once I looked into it, it is quite simple. $_POST
is global variable and contains all the POSTed data that was sent from the form.
For example, to email yourself all the posted data submitted in the form, you you could use something like this:
function email_me_post_data() {
global $_POST;
$msg = print_r($_POST, true);
mail('me@myemail.com', 'Example POST data', $msg);
}
add_action( 'user_register', 'email_me_post_data' );
Note that user_register action occurs AFTER the new user is created. Not sure you can get to the post data before user is created, although you could still modify data and re-save the changes.