Opened 9 years ago
Last modified 3 years ago
#37202 new defect (bug)
the_archive_title() doesn't output the author's display name if that author hasn't posted
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.5.3 |
Component: | Users | Keywords: | has-patch needs-testing |
Focuses: | template | Cc: |
Description
In my archive.php template, if I do this:
get_header(); the_archive_title( '<h1>', '</h1>' ); // Rest of code...
and then take a look at example.com/author/joebloggs, I expect to see:
Author: Joe Bloggs
The problem is if joebloggs hasn't posted yet, I see this:
Author:
Attachments (1)
Change History (6)
Note: See
TracTickets for help on using
tickets.
I've traced the issue back to the use of the
$authordata
global, which is used insideget_the_author()
.Dumping
$authordata
in the author template and then visiting a user's archive I get either an object of typeWP_User
(for users who have posted) ornull
(for users who haven't posted).