@@ 1390-1394 (lines=5) @@ | ||
1387 | function wp_insert_user( $userdata ) { |
|
1388 | global $wpdb; |
|
1389 | ||
1390 | if ( $userdata instanceof stdClass ) { |
|
1391 | $userdata = get_object_vars( $userdata ); |
|
1392 | } elseif ( $userdata instanceof WP_User ) { |
|
1393 | $userdata = $userdata->to_array(); |
|
1394 | } |
|
1395 | ||
1396 | // Are we updating or creating? |
|
1397 | if ( ! empty( $userdata['ID'] ) ) { |
|
@@ 1714-1718 (lines=5) @@ | ||
1711 | * @return int|WP_Error The updated user's ID or a WP_Error object if the user could not be updated. |
|
1712 | */ |
|
1713 | function wp_update_user($userdata) { |
|
1714 | if ( $userdata instanceof stdClass ) { |
|
1715 | $userdata = get_object_vars( $userdata ); |
|
1716 | } elseif ( $userdata instanceof WP_User ) { |
|
1717 | $userdata = $userdata->to_array(); |
|
1718 | } |
|
1719 | ||
1720 | $ID = isset( $userdata['ID'] ) ? (int) $userdata['ID'] : 0; |
|
1721 | if ( ! $ID ) { |