Filter
rpress_insert_user_args
On this page
Filters the arguments used to create a new user during checkout registration.
Runs in rpress_register_and_login_new_user before wp_insert_user() is called. The array contains user_login, user_pass, user_email, first_name, last_name, user_registered and role (the site default role). Use it to change the role or add fields accepted by wp_insert_user().
Parameters#
| Parameter | Type | Description |
|---|---|---|
$user_args | array | Arguments for wp_insert_user(). |
$user_data | array | Registration data submitted at checkout (user_login, user_pass, user_email, user_first, user_last). |
Return value#
array. Arguments passed to wp_insert_user().
Example#
function my_new_user_args( $user_args, $user_data ) {
$user_args['display_name'] = trim( $user_args['first_name'] . ' ' . $user_args['last_name'] );
return $user_args;
}
add_filter( 'rpress_insert_user_args', 'my_new_user_args', 10, 2 );
Source#
Applied in:
includes/process-purchase.php(line 827), inrpress_register_and_login_new_user()
See also#
Was this page helpful?
