Skip to content

Commit

Permalink
Merge pull request #926 from mattpramschufer/master
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryJones authored Jul 24, 2023
2 parents 3c66e21 + e442e28 commit ff90fc2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions co-authors-plus.php
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,7 @@ function current_user_can_set_authors() {
*/
public function fix_author_page( $selection ) {

global $wp_query, $authordata;
global $wp_query, $authordata, $post;

if ( ! isset( $wp_query ) ) {
return;
Expand All @@ -1194,7 +1194,12 @@ public function fix_author_page( $selection ) {
return;
}

$author = $this->get_coauthor_by( 'user_nicename', $author_name );
if ( ! isset( $post->post_author ) ) {
$author = $this->get_coauthor_by( 'user_nicename', $author_name );
} else {
$author = $this->get_coauthor_by( 'id', $post->post_author );
}

if ( is_object( $author ) ) {
$authordata = $author; //phpcs:ignore
$term = $this->get_author_term( $authordata );
Expand Down

0 comments on commit ff90fc2

Please sign in to comment.