[wp-trac] [WordPress Trac] #15888: show_fullname argument in wp_list_authors broken
WordPress Trac
wp-trac at lists.automattic.com
Sun Dec 19 06:44:49 UTC 2010
#15888: show_fullname argument in wp_list_authors broken
--------------------------+-----------------------------
Reporter: greenshady | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Template | Version: 3.1
Severity: normal | Keywords:
--------------------------+-----------------------------
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
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/15888>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list