diff --git a/lib/compat/wordpress-6.5/blocks.php b/lib/compat/wordpress-6.5/blocks.php index 44bf54bbc3e073..c3304a8f4a07f0 100644 --- a/lib/compat/wordpress-6.5/blocks.php +++ b/lib/compat/wordpress-6.5/blocks.php @@ -121,6 +121,9 @@ function gutenberg_block_bindings_replace_html( $block_content, $block_name, str } return $amended_button->get_updated_html(); } + if ( 'core/image' === $block_name && 'caption' === $attribute_name ) { + return preg_replace( '/(]*>)(.*?)(<\/figcaption>)/i', $amended_content->get_updated_html(), $block_content ); + } } else { $block_reader->seek( 'iterate-selectors' ); }