#4492 closed defect (bug) (wontfix)
Making wp_list_authors('show_fullname=1'); work when only first or last name entered
| Reported by: | spiff06 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | 2.2.1 |
| Severity: | normal | Keywords: | show_fullname wp_list_authors 2nd-opinion |
| Cc: | Focuses: |
Description
Spent a little time the other day trying to figure out why the full name wasn't displaying in the sidebar when pasting in the default code.
It turns out that all users on the site I tested only have a first name, never a last name. Yet the php function wp_list_authors() (in author-template.php) expects both fields to be present to display the full name:
if ( $show_fullname && ($author->first_name != '' && $author->last_name != '') ) $name = "$author->first_name $author->last_name";
I think changing the above code to the following might make sense:
if ( $show_fullname && ($author->first_name != '' || $author->last_name != '') )
$name = trim("$author->first_name $author->last_name");
This way, the actual name will be displayed as long as there's either a first name or a last name defined.
Thanks for the great work!
Change History (4)
#2
in reply to: ↑ 1
@
19 years ago
Replying to rob1n:
I'm -1 on this. "Full name" by definition is first and last name, so if there's no full name when show_fullname = 1, then show something else.
I concur with rob1n. show_fullname should return "" if there is no full name.
#3
@
19 years ago
- Milestone 2.4 (future)
- Resolution → wontfix
- Status new → closed
Also -1 for me, for the same reason as rob1n mentioned.
As that makes 3 times "no", I'm closing it as wontfix.
Please feel free to reopen if you have additional information/suggestions/...
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I'm -1 on this. "Full name" by definition is first and last name, so if there's no full name when show_fullname = 1, then show something else.