wphooks.info - wp_pre_insert_user_data

wp_pre_insert_user_data

(trunk - 5.0-alpha-42716)

The hook occurs in the following file:

wp-includes/user.php:
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
	 *     @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.
	 * }
	 * @param bool     $update Whether the user is being updated rather than created.
	 * @param int|null $id     ID of the user to be updated, or NULL if the user is being created.
	 */
	$data = apply_filters( 'wp_pre_insert_user_data', $data, $update, $update ? (int) $ID : null );

	if ( $update ) {
		if ( $user_email !== $old_user_data->user_email ) {
			$data['user_activation_key'] = '';
		}
		$wpdb->update( $wpdb->users, $data, compact( 'ID' ) );
		$user_id = (int) $ID;
	} else {
		$wpdb->insert( $wpdb->users, $data );