Skip to content

Commit c395242

Browse files
authored
Add "supports.interactivity" to Image block (WordPress#53850)
1 parent 9bd56dc commit c395242

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/block-library/src/image/index.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ function render_block_core_image( $attributes, $content, $block ) {
5454
$should_load_view_script = true;
5555
}
5656

57+
// If at least one block in the page has the lightbox, mark the block type as interactive.
58+
if ( $should_load_view_script ) {
59+
$block->block_type->supports['interactivity'] = true;
60+
}
61+
5762
$view_js_file = 'wp-block-image-view';
5863
if ( ! wp_script_is( $view_js_file ) ) {
5964
$script_handles = $block->block_type->view_script_handles;

0 commit comments

Comments
 (0)