diff --git a/wp-includes/blocks/latest-posts.php b/wp-includes/blocks/latest-posts.php index b8fc02cf80..f1b3c78b5c 100644 --- a/wp-includes/blocks/latest-posts.php +++ b/wp-includes/blocks/latest-posts.php @@ -53,11 +53,16 @@ function render_block_core_latest_posts( $attributes ) { if ( isset( $attributes['displayPostContent'] ) && $attributes['displayPostContent'] && isset( $attributes['displayPostContentRadio'] ) && 'excerpt' === $attributes['displayPostContentRadio'] ) { $post_excerpt = $post->post_excerpt; + if ( ! ( $post_excerpt ) ) { $post_excerpt = $post->post_content; } $trimmed_excerpt = esc_html( wp_trim_words( $post_excerpt, $excerpt_length, ' … ' ) ); + if ( post_password_required( $post ) ) { + $trimmed_excerpt = __( 'This content is password protected.' ); + } + $list_items_markup .= sprintf( '