Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 14 years ago

#10632 closed defect (bug) (invalid)

update_usermeta should allow blank values

Reported by: jfarthing84's profile jfarthing84 Owned by: jfarthing84's profile jfarthing84
Milestone: Priority: normal
Severity: normal Version: 2.8.4
Component: General Keywords: 2nd-opinion, has-patch
Focuses: Cc:


I think it would be better if update_usermeta was allowed to insert '0' or blank values, instead of deleting them. First of all, if I wanted to delete the value, I would have called delete_usermeta. Second of all, update_post_meta allows it, so why not update_usermeta?

Attachments (2)

user.php.2.diff (404 bytes) - added by jfarthing84 15 years ago.
user.php.diff (404 bytes) - added by jfarthing84 15 years ago.

Download all attachments as: .zip

Change History (7)

#1 @jfarthing84
15 years ago

  • Owner set to jfarthing84
  • Status changed from new to accepted

#2 @jfarthing84
15 years ago

Sorry, I didn't realize on the first attachment that my code editor had converted the tabs from 6 spaces to 4, so it DIFFed the whole file. I uploaded the correct version. Instead of checking the meta value with the empty() function, just check for an empty string, that way the user meta value can be set to 0 if need be.

#3 @jfarthing84
15 years ago

  • Keywords has-patch added

#4 @jfarthing84
15 years ago

  • Resolution set to invalid
  • Status changed from accepted to closed

#5 @Denis-de-Bernardy
14 years ago

  • Milestone Unassigned deleted
Note: See TracTickets for help on using tickets.