Skip to content

Commit

Permalink
Add support for image caption
Browse files Browse the repository at this point in the history
  • Loading branch information
SantosGuillamot committed Apr 30, 2024
1 parent 2671112 commit 0ca0b37
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/compat/wordpress-6.5/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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[^>]*>)(.*?)(<\/figcaption>)/i', $amended_content->get_updated_html(), $block_content );
}
} else {
$block_reader->seek( 'iterate-selectors' );
}
Expand Down

0 comments on commit 0ca0b37

Please sign in to comment.