Skip to content

Commit ab7369e

Browse files
kishanjasaniSiobhyB
authored andcommitted
Bug: PHP notice when an image with lightbox is deleted (#55370)
* Fix PHP notice when an image with lightbox is deleted * Fix PHP notice when an image with lightbox is deleted
1 parent fe74c65 commit ab7369e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ function block_core_image_render_lightbox( $block_content, $block ) {
170170
if ( isset( $block['attrs']['id'] ) ) {
171171
$img_uploaded_src = wp_get_attachment_url( $block['attrs']['id'] );
172172
$img_metadata = wp_get_attachment_metadata( $block['attrs']['id'] );
173-
$img_width = $img_metadata['width'];
174-
$img_height = $img_metadata['height'];
173+
$img_width = $img_metadata['width'] ?? 'none';
174+
$img_height = $img_metadata['height'] ?? 'none';
175175
} else {
176176
$img_uploaded_src = $processor->get_attribute( 'src' );
177177
$img_width = 'none';

0 commit comments

Comments
 (0)