Skip to content

Commit

Permalink
Don't check get_the_author()
Browse files Browse the repository at this point in the history
If a post has no wordpress owner, but has an guest author,
a check of `get_the_author()` will fail.
  • Loading branch information
leedxw committed Nov 21, 2024
1 parent 9c6e72d commit aace99d
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions lib/byline.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@
function gds_byline()
{
?>
<span class="govuk-visually-hidden">Posted by: </span>
<?php
if (function_exists('coauthors_posts_links')) {
if (get_the_author()) {
coauthors_posts_links(', ');
}

} else {
?> <a href="<?php echo get_author_posts_url(get_the_author_meta('ID')) ?>" rel="author" class="govuk-link"><?php echo get_the_author() ?></a> <?php
}
<span class="govuk-visually-hidden">Posted by: </span>
<?php
if (function_exists('coauthors_posts_links')) {
coauthors_posts_links(', ');
} else {
?> <a href="<?php echo get_author_posts_url(get_the_author_meta('ID')) ?>" rel="author" class="govuk-link"><?php echo get_the_author() ?></a> <?php
}
}

0 comments on commit aace99d

Please sign in to comment.