Skip to content

Commit

Permalink
Remove additional string concatenation
Browse files Browse the repository at this point in the history
  • Loading branch information
mikachan committed Oct 9, 2023
1 parent ca48382 commit 6e74cd9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/wp-includes/blocks/latest-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,12 @@ function render_block_core_latest_posts( $attributes ) {
$excerpt_length = (int) apply_filters( 'excerpt_length', $block_core_latest_posts_excerpt_length );
if ( $excerpt_length <= $block_core_latest_posts_excerpt_length ) {
$trimmed_excerpt = substr( $trimmed_excerpt, 0, -11 );
$trimmed_excerpt .= '… <a href="' . esc_url( $post_link ) . '" rel="noopener noreferrer">';
$trimmed_excerpt .= sprintf(
/* translators: %s: The post title only visible to screen readers */
__( 'Continue reading <span class="screen-reader-text">%s</span>' ),
/* translators: 1: A URL to a post, 2: The post title only visible to screen readers. */
__( '… <a href="%1$s" rel="noopener noreferrer">Read more<span class="screen-reader-text">: %3$s</span></a>' ),
esc_url( $post_link ),
esc_html( $title )
);
$trimmed_excerpt .= '</a>';
}
}

Expand Down

0 comments on commit 6e74cd9

Please sign in to comment.