diff --git a/wp-includes/user.php b/wp-includes/user.php
index dcd102623..cfc2d5e3b 100644
a
|
b
|
function wp_insert_user( $userdata ) { |
1627 | 1627 | $compacted = compact( 'user_pass', 'user_email', 'user_url', 'user_nicename', 'display_name', 'user_registered' ); |
1628 | 1628 | $data = wp_unslash( $compacted ); |
1629 | 1629 | |
| 1630 | if ( ! $update ) { |
| 1631 | $data = $data + compact( 'user_login' ); |
| 1632 | } |
| 1633 | |
| 1634 | /** |
| 1635 | * Filters user's data before the record is created or updated. |
| 1636 | * |
| 1637 | * It only includes data in Users table wp_user, not including any user metadata. |
| 1638 | * |
| 1639 | * @since 4.7.x |
| 1640 | * |
| 1641 | * @param array $data { |
| 1642 | * Values and keys for the user. |
| 1643 | * |
| 1644 | * @type string $user_login The user's login. Only included if $update == false |
| 1645 | * @type string $user_pass The user's password. |
| 1646 | * @type string $user_email The user's email. |
| 1647 | * @type string $user_url The user's url. |
| 1648 | * @type string $user_nicename The user's nice name. Defaults to a URL-safe version of user's login |
| 1649 | * @type string $display_name The user's display name. |
| 1650 | * @type string $user_registered MySQL timestamp describing the moment when the user registered. Defaults to |
| 1651 | * the current UTC timestamp. |
| 1652 | * } |
| 1653 | * @param bool $update Whether the user is being updated rather than created. |
| 1654 | */ |
| 1655 | $data = apply_filters( 'wp_pre_insert_user_data', $data, $update ); |
| 1656 | |
1630 | 1657 | if ( $update ) { |
1631 | 1658 | if ( $user_email !== $old_user_data->user_email ) { |
1632 | 1659 | $data['user_activation_key'] = ''; |
… |
… |
function wp_insert_user( $userdata ) { |
1634 | 1661 | $wpdb->update( $wpdb->users, $data, compact( 'ID' ) ); |
1635 | 1662 | $user_id = (int) $ID; |
1636 | 1663 | } else { |
1637 | | $wpdb->insert( $wpdb->users, $data + compact( 'user_login' ) ); |
| 1664 | $wpdb->insert( $wpdb->users, $data ); |
1638 | 1665 | $user_id = (int) $wpdb->insert_id; |
1639 | 1666 | } |
1640 | 1667 | |