diff --git a/co-authors-plus.php b/co-authors-plus.php index 951d652a..f3d6f0d0 100755 --- a/co-authors-plus.php +++ b/co-authors-plus.php @@ -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; @@ -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 );