Opened 16 years ago
Closed 16 years ago
#15888 closed defect (bug) (fixed)
show_fullname argument in wp_list_authors broken
| Reported by: | greenshady | Owned by: | |
|---|---|---|---|
| Priority: | highest omg bbq | Milestone: | 3.1 |
| Component: | Template | Version: | 3.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
The problem seems to come from the change in #10329 to make wp_list_authors() use the get_users() function. The show_fullname argument relies on the first_name and last_name user meta keys, which aren't a part of the user objects returned from the user query.
In the wp_list_authors() function in author-template.php, we're checking for $author->first_name and $author->last_name, which will never be true, so it always shows $author->display_name:
if ( $show_fullname && $author->first_name && $author->last_name ) $name = "$author->first_name $author->last_name"; else $name = $author->display_name;
WP_DEBUG message:
Notice: Undefined property: stdClass::$first_name in C:\xampplite\htdocs\wp-includes\author-template.php on line 305
Attachments (1)
Change History (5)
#3
@
16 years ago
- Keywords has-patch added
15888.diff retrieves only the ids and then calls get_userdata(), just like in 3.0.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I believe this broke in [17013] and now wp_list_authors does not use 'all_with_meta' because it causes fatal errors if a lot of users will be returned by the query.