#14855 closed defect (bug) (invalid)
WP_User misses values for some default properties (nickname, rich_editing)
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 3.1 |
| Component: | Users | Keywords: | has-patch |
| Focuses: | Cc: |
Description
WP_User is expected to have default properties like last_name, ID etc.
At least two of them are missing in the class definition:
- nickname
- rich_editing
The attached patch adds them.
/wp-admin/user-edit.php does Warnings / Notices if the properties are not set.
This is the case for users in the database that have not set these fields as meta data.
Attachments (2)
Change History (10)
#1
@
15 years ago
- Summary changed from WP_User misses values for some default proerties (nickname, rich_editing) to WP_User misses values for some default properties (nickname, rich_editing)
- Version set to 3.1
#3
follow-up:
↓ 4
@
15 years ago
For the default: http://core.trac.wordpress.org/browser/tags/3.0.1/wp-includes/registration.php#L166
Also, how were these users created? These should be created on registration.
#4
in reply to:
↑ 3
@
15 years ago
Replying to nacin:
For the default: http://core.trac.wordpress.org/browser/tags/3.0.1/wp-includes/registration.php#L166
Updated to defaults, added $user_login because it contains the default value for the notice giving $nickname according to the code you linked.
Also, how were these users created? These should be created on registration.
These users were created by inserting them into the database directly by providing only the required subset of user-metas to make WordPress them able to logon.
So those users are directly loaded out of the DB, identified as being valid and are even run through the sanitization functions but still miss those values which are expected to be existing on user-edit.php giving notices there.
It might make sense to add something in the sanitization as well, so to make validate_username() and sanitize_user_object() working together more closely.
#5
@
15 years ago
- Milestone changed from Awaiting Review to Future Release
This seems fine. We should check if others need to be added as well, like admin_color, show_admin_bar_front, and show_admin_bar_admin.
This adds the two properties and their default values. I was unsure on the version with which those properties were introduced so I chooses 3.1.0 for now.
I was not sure about rich_editing default, so I choosed false. I was not able to clarify it's default value, so this must be reviewed in case it's important. I don't think so.