Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions php/integrations/yoast.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Yoast\WP\SEO\Generators\Schema\Abstract_Schema_Piece;
use Yoast\WP\SEO\Presentations\Indexable_Author_Archive_Presentation;
use WP_User;
use function __;

/**
* The main Yoast integration class
Expand Down Expand Up @@ -256,7 +257,7 @@ public static function filter_slack_data( $data, $presentation ): array {
}

$output = self::get_authors_display_names_output( $author_objects );
$data[ \__( 'Written by', 'co-authors-plus' ) ] = $output;
$data[ __( 'Written by', 'co-authors-plus' ) ] = $output;
return $data;
}

Expand Down Expand Up @@ -339,7 +340,7 @@ public static function fix_guest_author_archive_url_presenter( $url, $presenter
* @return array Modified $replacements.
*/
public static function filter_author_name_variable( $replacements, $args ): array {
if ( isset( $replacements['%%name%%'], $args->ID ) ) {
if ( isset( $replacements['%%name%%'], $args->ID ) && is_single() ) {
$author_objects = get_coauthors( $args->ID );

// Fallback in case of error.
Expand Down