Opened 14 years ago
Closed 14 years ago
#14924 closed defect (bug) (fixed)
author/user meta data extraction error
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | major | Version: | 3.0.1 |
Component: | Users | Keywords: | user, author, meta |
Focuses: | Cc: |
Description
It seems that if user meta data fields are created with dashes '-' then retrieval functions fail. Fields are properly stored in the database but retrieving with "get_the_author_meta" fails.
When I manually changed the field names to underscores '_' they were extracted OK. When I changes them back to dashes '-' they again failed.
Change History (4)
#2
@
14 years ago
I may be missing them - but the code you linked to seems to relate to basic user fields while I was referring to meta data (custom fields that I added) ... if it is as you say - it is an unclear and undocumented inconsistency. I would expect the two functions to behave identically.
Note: See
TracTickets for help on using
tickets.
using get_user_meta() works as expected.
The cause here is that the User object will store 'test-key' as 'testkey' due to dashes not being allowed in class properties thanks to this code: http://core.trac.wordpress.org/browser/trunk/wp-includes/user.php#L923