Filters a username after it has been sanitized. This filter is called before the user is created or updated.
$userdata
Sortie :
@param string $sanitized_user_login Username after it has been sanitized.
@param array $usernames Array of disallowed usernames.
@param string $user_nicename The user's nicename.
@param string $raw_user_email The user's email.
@param string $raw_user_url The user's URL.
@param string $nickname The user's nickname.
@param string $first_name The user's first name.
@param string $last_name The user's last name.
@param string $display_name The user's display name.
@param string $description The user's description.
@param array $data {
@param bool $update Whether the user is being updated rather than created.
@param int|null $user_id ID of the user to be updated, or NULL if the user is being created.
@param array $userdata The raw array of data passed to wp_insert_user().
@param array $meta {
@param WP_User $user User object.
@param bool $update Whether the user is being updated rather than created.
@param array $userdata The raw array of data passed to wp_insert_user().
@param array $custom_meta Array of custom user meta values keyed by meta key.
@param WP_User $user User object.
@param bool $update Whether the user is being updated rather than created.
@param array $userdata The raw array of data passed to wp_insert_user().
@param int $user_id User ID.
@param WP_User $old_user_data Object containing user's data prior to update.
@param array $userdata The raw array of data passed to wp_insert_user().
@param int $user_id ID of the user marked as SPAM.
@param int $user_id ID of the user marked as HAM.
@param int $user_id User ID.
@param array $userdata The raw array of data passed to wp_insert_user().
@param array|object|WP_User $userdata An array of user data or a user object of type stdClass or WP_User.
@return int|WP_Error The updated user's ID or a WP_Error object if the user could not be updated.
// Utilisation de la fonction wp_update_user
$result = wp_update_user($userdata);
if ($result) {
// Votre logique ici
}
Chargement des actualités...