diff --git a/lib/block-supports/behaviors.php b/lib/block-supports/behaviors.php index c1b3dceceee94..383f4b4e6f927 100644 --- a/lib/block-supports/behaviors.php +++ b/lib/block-supports/behaviors.php @@ -109,8 +109,8 @@ function gutenberg_render_behaviors_support_lightbox( $block_content, $block ) { if ( isset( $block['attrs']['id'] ) ) { $img_uploaded_src = wp_get_attachment_url( $block['attrs']['id'] ); $img_metadata = wp_get_attachment_metadata( $block['attrs']['id'] ); - $img_width = $img_metadata['width']; - $img_height = $img_metadata['height']; + $img_width = $img_metadata['width'] ?? 'none'; + $img_height = $img_metadata['height'] ?? 'none'; } else { $img_uploaded_src = $processor->get_attribute( 'src' ); $img_width = 'none';