Filters user data before the record is created or updated.
Description
It only includes data in the users table, not any user metadata.
Parameters
$dataarray
{ Values and keys for the user. @type string $user_login The user's login. Only included if $update == false @type string $user_pass The user's password. @type string $user_email The user's email. @type string $user_url The user's url. @type string $user_nicename The user's nice name. Defaults to a URL-safe version of user's login. @type string $display_name The user's display name. @type string $user_registered MySQL timestamp describing the moment when the user registered. Defaults to the current UTC timestamp.}
$user_loginstring
The user's login. Only included if $update == false @type string $user_pass The user's password.
$user_emailstring
The user's email.
$user_urlstring
The user's url.
$user_nicenamestring
The user's nice name. Defaults to a URL-safe version of user's login.
$display_namestring
The user's display name.
$user_registeredstring
MySQL timestamp describing the moment when the user registered. Defaults to the current UTC timestamp.
$updatebool
Whether the user is being updated rather than created.
$user_idint|null
ID of the user to be updated, or NULL if the user is being created.
2404* the current UTC timestamp.2405*}2406* @param bool$update Whether the user is being updated rather than created.2407* @param int|null$user_idID of the user to be updated,orNULLif the user is being created.2408* @param array$userdata The raw array of data passed to wp_insert_user().2409*/2410$data=apply_filters('wp_pre_insert_user_data',$data,$update,($update?$user_id:null),$userdata);24112412if(empty($data)||!is_array($data)){2413returnnewWP_Error('empty_data',__('Not enough data to create this user.'));2414}24152416if($update){
History
Introduced in 4.9.0. Unchanged from 6.7.7 through 7.1.0.