Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#10632 closed defect (bug) (invalid)

update_usermeta should allow blank values

Reported by: jfarthing84 Owned by: 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 6 years ago.
user.php.diff (404 bytes) - added by jfarthing84 6 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 @jfarthing846 years ago

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

@jfarthing846 years ago

@jfarthing846 years ago

comment:2 @jfarthing846 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.

comment:3 @jfarthing846 years ago

  • Keywords has-patch added

comment:4 @jfarthing846 years ago

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

comment:5 @Denis-de-Bernardy6 years ago

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