Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#32684 closed defect (bug) (fixed)

wp_update_user() is the 'user_email' now a required $userdata arg for updating a user ?

Reported by: imath Owned by: boonebgorges
Priority: normal Milestone: 4.3
Component: Users Version: 4.3
Severity: normal Keywords:
Cc: Focuses:

Description

in r32820 there's a new check on $userdata['user_email'] to see if an email should be send if i understand well.

My problem is: if i want to update the display name, doing something like this :

// Update the display_name
wp_update_user( array(
	'ID'                  => $user_id,
	'display_name' => $display_name,
) );

Then i get an error because $userdata['user_email'] is not set in my array.

If the user_email is now required, then simply close this ticket.

imho maybe an isset( $userdata['user_mail'] ) before comparing it to $useruser_email would be nice, because i might not be the only one using wp_update_user() the way i've described above.

Attachments (1)

32684.patch (537 bytes ) - added by imath 11 years ago.

Download all attachments as: .zip

Change History (4)

@imath
11 years ago

#1 @SergeyBiryukov
11 years ago

  • Milestone Awaiting Review4.3

#2 @boonebgorges
11 years ago

Confirmed. This change is also breaking a lot of unit tests.

#3 @boonebgorges
11 years ago

  • Owner set to boonebgorges
  • Resolutionfixed
  • Status newclosed

In 32838:

When updating a user, only send email-change notification if email address is passed.

The notification, introduced in [32380], was firing incorrectly (and throwing
a PHP notice) when wp_update_user() was called without including 'user_email'
in the update data.

Props imath.
Fixes #32684. See #32430.

Note: See TracTickets for help on using tickets.