From db280757ca3accf48c508d374ca58b6389e5b134 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Tue, 20 Jan 2026 16:00:26 +1000 Subject: [PATCH] Mock Blocks: Update to match current latest comments block attributes See upstream change: https://github.com/WordPress/gutenberg/commit/703897aada87cf7fb2c4307b390c26a025142b84 --- .../plugins/pattern-creator/includes/mock-blocks.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/public_html/wp-content/plugins/pattern-creator/includes/mock-blocks.php b/public_html/wp-content/plugins/pattern-creator/includes/mock-blocks.php index 4d3e9b3f1..214d78a71 100644 --- a/public_html/wp-content/plugins/pattern-creator/includes/mock-blocks.php +++ b/public_html/wp-content/plugins/pattern-creator/includes/mock-blocks.php @@ -101,6 +101,12 @@ function render_latest_comments( $block_content, $block, $block_instance ) { $attributes = $block_instance->attributes; $list_items_markup = ''; + if ( isset( $attributes['displayExcerpt'] ) ) { + $display_content = $attributes['displayExcerpt'] ? 'excerpt' : 'none'; + } else { + $display_content = isset( $attributes['displayContent'] ) ? $attributes['displayContent'] : 'excerpt'; + } + /* Note: This is not translated (for now) because the post content is also not translated. */ $comments = array( [ @@ -151,7 +157,9 @@ function render_latest_comments( $block_content, $block, $block_instance ) { ); } $list_items_markup .= ''; - if ( $attributes['displayExcerpt'] ) { + if ( 'full' === $display_content ) { + $list_items_markup .= '
' . wpautop( $comment['content'] ) . '
'; + } elseif ( 'excerpt' === $display_content ) { $list_items_markup .= '
' . $comment['content'] . '
'; } $list_items_markup .= ''; @@ -164,7 +172,7 @@ function render_latest_comments( $block_content, $block, $block_instance ) { if ( $attributes['displayDate'] ) { $classnames[] = 'has-dates'; } - if ( $attributes['displayExcerpt'] ) { + if ( 'none' !== $display_content ) { $classnames[] = 'has-excerpts'; }