Opened 14 years ago
Closed 14 years ago
#15888 closed defect (bug) (fixed)
show_fullname argument in wp_list_authors broken
Reported by: | greenshady | Owned by: | |
---|---|---|---|
Milestone: | 3.1 | Priority: | highest omg bbq |
Severity: | normal | Version: | 3.1 |
Component: | Template | Keywords: | has-patch |
Focuses: | Cc: |
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)
Note: See
TracTickets for help on using
tickets.
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.