$list_items_markup .= '<article>';
$list_items_markup .= '<footer class="wp-block-latest-comments__comment-meta">';
$author_url =
get_comment_author_url( $comment );
if ( empty( $author_url ) && !
empty( $comment->user_id
) ) { $author_url =
get_author_posts_url( $comment->user_id
);
} $author_markup = '';
if ( $author_url ) { $author_markup .= '<a class="wp-block-latest-comments__comment-author" href="' .
esc_url( $author_url ) . '">' .
get_comment_author( $comment ) . '</a>';
} else { $author_markup .= '<span class="wp-block-latest-comments__comment-author">' .
get_comment_author( $comment ) . '</span>';
} // `_draft_or_post_title` calls `esc_html()` so we don't need to wrap that call in
// `esc_html`.
$post_title = '<a class="wp-block-latest-comments__comment-link" href="' .
esc_url( get_comment_link( $comment ) ) . '">' .
wp_latest_comments_draft_or_post_title( $comment->comment_post_ID
) . '</a>';
$list_items_markup .=
sprintf( /* translators: 1: author name (inside <a> or <span> tag, based on if they have a URL), 2: post title related to this comment */
__( '%1$s on %2$s'
),