Filters a user’s meta values and keys immediately after the user is created or updated and before any user meta is inserted or updated.
Description
Does not include contact methods. These are added using wp_get_user_contact_methods( $user ).
For custom meta fields, see the ‘insert_custom_user_meta’ filter.
Parameters
$metaarray- Default meta values and keys for the user.
nicknamestringThe user’s nickname. Default is the user’s username.first_namestringThe user’s first name.last_namestringThe user’s last name.descriptionstringThe user’s description.rich_editingstringWhether to enable the rich-editor for the user. Default'true'.syntax_highlightingstringWhether to enable the rich code editor for the user. Default'true'.comment_shortcutsstringWhether to enable keyboard shortcuts for the user. Default'false'.admin_colorstringThe color scheme for a user’s admin screen. Default'fresh'.use_sslint|boolWhether to force SSL on the user’s admin area.0|falseif SSL is not forced.show_admin_bar_frontstringWhether to show the admin bar on the front end for the user.
Default'true'.localestringUser’s locale. Default empty.
$userWP_User- User object.
$updatebool- Whether the user is being updated rather than created.
$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 for new users.
Hashed password for existing users.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.
Source
$meta = apply_filters( 'insert_user_meta', $meta, $user, $update, $userdata );
User Contributed Notes
You must log in before being able to contribute a note or feedback.