wp/wp-includes/blocks/post-author-name.php
changeset 22 8c2e4d02f4ef
parent 21 48c4eec2b7e6
--- a/wp/wp-includes/blocks/post-author-name.php	Fri Sep 05 18:40:08 2025 +0200
+++ b/wp/wp-includes/blocks/post-author-name.php	Fri Sep 05 18:52:52 2025 +0200
@@ -26,6 +26,10 @@
 		return '';
 	}
 
+	if ( isset( $block->context['postType'] ) && ! post_type_supports( $block->context['postType'], 'author' ) ) {
+		return '';
+	}
+
 	$author_name = get_the_author_meta( 'display_name', $author_id );
 	if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) {
 		$author_name = sprintf( '<a href="%1$s" target="%2$s" class="wp-block-post-author-name__link">%3$s</a>', get_author_posts_url( $author_id ), esc_attr( $attributes['linkTarget'] ), $author_name );