Skip to content

Commit

Permalink
Wrong Author name on Yoast Description #1898
Browse files Browse the repository at this point in the history
  • Loading branch information
ojopaul committed Dec 13, 2024
1 parent d984969 commit fc6b794
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/yoast-seo-integration/yoast-seo-integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,11 @@ public function overrideSEOReplacementsForAuthorsPage($replacements, $args)
if (!is_object($post) || is_wp_error($post)) {
return $replacements;
}
$archiveAuthor = get_archive_author();

foreach ($replacements as $key => &$value) {
if ($key === '%%name%%') {
$authors = get_post_authors($post->ID);
$authors = $archiveAuthor && !empty($archiveAuthor) ? [$archiveAuthor] : get_post_authors($post->ID);

if (is_array($authors) && !empty($authors)) {
$author = $authors[0];
Expand Down

0 comments on commit fc6b794

Please sign in to comment.