Open
Description
openedon Oct 10, 2023
Description
The gallery block does not update its markup when images are removed.
Step-by-step reproduction instructions
- Add a gallery block with multiple images.
- Adjust the number of columns away from the default.
- Duplicate it and remove one of the images
- Inspect the markup in the front end or the markup and block metadata in the code view of the editor.
Screenshots, screen recording, code snippet
<!-- Original gallery with two images: -->
<!-- wp:gallery {"columns":2,"linkTo":"none"} -->
<figure class="wp-block-gallery has-nested-images columns-2 is-cropped"><!-- wp:image {"id":56,"aspectRatio":"1","scale":"cover","sizeSlug":"large","linkDestination":"none"} -->
<figure class="wp-block-image size-large"><img src="http://stock.local/wp-content/uploads/2022/01/761eb638-10a7-3784-957b-51c63c28c58c-1024x683.jpg" alt="" class="wp-image-56" style="aspect-ratio:1;object-fit:cover"/></figure>
<!-- /wp:image -->
<!-- wp:image {"id":56,"aspectRatio":"1","scale":"cover","sizeSlug":"large","linkDestination":"none"} -->
<figure class="wp-block-image size-large"><img src="http://stock.local/wp-content/uploads/2022/01/761eb638-10a7-3784-957b-51c63c28c58c-1024x683.jpg" alt="" class="wp-image-56" style="aspect-ratio:1;object-fit:cover"/></figure>
<!-- /wp:image --></figure>
<!-- /wp:gallery -->
<!-- Duplicated gallery with one image deleted: -->
<!-- wp:gallery {"columns":2,"linkTo":"none"} -->
<figure class="wp-block-gallery has-nested-images columns-2 is-cropped"><!-- wp:image {"id":56,"aspectRatio":"1","scale":"cover","sizeSlug":"large","linkDestination":"none"} -->
<figure class="wp-block-image size-large"><img src="http://stock.local/wp-content/uploads/2022/01/761eb638-10a7-3784-957b-51c63c28c58c-1024x683.jpg" alt="" class="wp-image-56" style="aspect-ratio:1;object-fit:cover"/></figure>
<!-- /wp:image --></figure>
<!-- /wp:gallery -->
Notice the "columns":2
and columns-2
class.
Environment info
- Latest version of Wordpress, not using the plugin
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
Needs further testing to be confirmed.Needs further testing to be confirmed.Affects the Gallery Block - used to display groups of imagesAffects the Gallery Block - used to display groups of imagesAn existing feature does not function as intendedAn existing feature does not function as intended