Filter
rpress_insert_user_data
On this page
Filters the registration data after the checkout user has been created.
Runs right after wp_insert_user() succeeds. The filtered value is passed to the rpress_insert_user action and then used to log the new user in, so user_login and user_pass must remain present. Changing it does not alter the stored user.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$user_data | array | Registration data submitted at checkout. |
$user_args | array | The arguments that were passed to wp_insert_user(). |
Return value#
array. The registration data; must keep user_login and user_pass.
Example#
function my_insert_user_data( $user_data, $user_args ) {
$user_data['user_role'] = $user_args['role'];
return $user_data;
}
add_filter( 'rpress_insert_user_data', 'my_insert_user_data', 10, 2 );
Source#
Applied in:
includes/process-purchase.php(line 842), inrpress_register_and_login_new_user()
See also#
Was this page helpful?
