Skip to content

Commit

Permalink
Bug: PHP notice when an image with lightbox is deleted (#55370)
Browse files Browse the repository at this point in the history
* Fix PHP notice when an image with lightbox is deleted

* Fix PHP notice when an image with lightbox is deleted
  • Loading branch information
kishanjasani authored Oct 16, 2023
1 parent ba70382 commit d9a75d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/block-library/src/image/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ function block_core_image_render_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';
Expand Down

1 comment on commit d9a75d0

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in d9a75d0.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6533412439
📝 Reported issues:

Please sign in to comment.