diff -r be944660c56a -r 3d72ae0968f4 wp/wp-includes/blocks/comment-author-name.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wp/wp-includes/blocks/comment-author-name.php Tue Sep 27 16:37:53 2022 +0200 @@ -0,0 +1,62 @@ +context['commentId'] ) ) { + return ''; + } + + $comment = get_comment( $block->context['commentId'] ); + $commenter = wp_get_current_commenter(); + $show_pending_links = isset( $commenter['comment_author'] ) && $commenter['comment_author']; + if ( empty( $comment ) ) { + return ''; + } + + $classes = ''; + if ( isset( $attributes['textAlign'] ) ) { + $classes .= 'has-text-align-' . $attributes['textAlign']; + } + + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) ); + $comment_author = get_comment_author( $comment ); + $link = get_comment_author_url( $comment ); + + if ( ! empty( $attributes['isLink'] ) && ! empty( $attributes['linkTarget'] ) ) { + $comment_author = sprintf( '%3s', esc_url( $link ), esc_attr( $attributes['linkTarget'] ), $comment_author ); + } + if ( '0' === $comment->comment_approved && ! $show_pending_links ) { + $comment_author = wp_kses( $comment_author, array() ); + } + + return sprintf( + '