WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#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:
Milestone: Priority: normal
Severity: normal Version: 2.2.1
Component: General Keywords: show_fullname wp_list_authors 2nd-opinion
Focuses: Cc:

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 (3)

comment:1 follow-up: rob1n7 years ago

  • Keywords 2nd-opinion added
  • Milestone changed from 2.2.2 to 2.4 (future)

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.

comment:2 in reply to: ↑ 1 strider727 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.

comment:3 Nazgul7 years ago

  • Milestone 2.4 (future) deleted
  • Resolution set to wontfix
  • Status changed from new to 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/...

Note: See TracTickets for help on using tickets.