On this page
do_action( 'user_register', int $user_id, array $userdata )
Fires immediately after a new user is registered.
Parameters
$user_idint-
User ID.
$userdataarray-
The raw array of data passed to wp_insert_user() .
More Arguments from wp_insert_user( ... $userdata )
An array, object, or WP_User object of user data arguments.
IDintUser ID. If supplied, the user will be updated.user_passstringThe plain-text user password.user_loginstringThe user's login username.user_nicenamestringThe URL-friendly user name.user_urlstringThe user URL.user_emailstringThe user email address.display_namestringThe user's display name.
Default is the user's username.nicknamestringThe user's nickname.
Default is the user's username.first_namestringThe user's first name. For new users, will be used to build the first part of the user's display name if$display_nameis not specified.last_namestringThe user's last name. For new users, will be used to build the second part of the user's display name if$display_nameis not specified.descriptionstringThe user's biographical description.rich_editingstringWhether to enable the rich-editor for the user.
Accepts'true'or'false'as a string literal, not boolean. Default'true'.syntax_highlightingstringWhether to enable the rich code editor for the user.
Accepts'true'or'false'as a string literal, not boolean. Default'true'.comment_shortcutsstringWhether to enable comment moderation keyboard shortcuts for the user. Accepts'true'or'false'as a string literal, not boolean. Default'false'.admin_colorstringAdmin color scheme for the user. Default'fresh'.use_sslboolWhether the user should always access the admin over https. Default false.user_registeredstringDate the user registered in UTC. Format is 'Y-m-d H:i:s'.user_activation_keystringPassword reset key. Default empty.spamboolMultisite only. Whether the user is marked as spam.
Default false.show_admin_bar_frontstringWhether to display the Admin Bar for the user on the site's front end. Accepts'true'or'false'as a string literal, not boolean. Default'true'.rolestringUser's role.localestringUser's locale. Default empty.meta_inputarrayArray of custom user meta values keyed by meta key.
Default empty.
More Information
This action hook allows you to access data for a new user immediately after they are added to the database. The user id is passed to hook as an argument.
Not all user meta data has been stored in the database when this action is triggered. For example, nickname is in the database but first_name and last_name are not (as of v3.9.1). The password has already been encrypted when this action is triggered.
Typically, this hook is used for saving additional user meta passed by custom registration forms.
Source
File: wp-includes/user.php. View all references
do_action( 'user_register', $user_id, $userdata );
Related
Used By
| Used By | Description |
|---|---|
| wp_insert_user() wp-includes/user.php | Inserts a user into the database. |
Changelog
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/user_register