-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gallery: Add a deprecation for captions in the gallery block (#45173)
Co-authored-by: Glen Davies <[email protected]>
- Loading branch information
1 parent
5f02c27
commit 9d48cb0
Showing
5 changed files
with
428 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
test/integration/fixtures/blocks/core__gallery__deprecated-7.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!-- wp:gallery {"linkTo":"media"} --> | ||
<figure class="wp-block-gallery has-nested-images columns-default is-cropped"> | ||
<!-- wp:image {"id":705,"sizeSlug":"large","linkDestination":"media"} --> | ||
<figure class="wp-block-image size-large"><a href="http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1-682x1024.jpg"><img src="http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1-682x1024.jpg" alt="" class="wp-image-705"/></a></figure> | ||
<!-- /wp:image --> | ||
|
||
<!-- wp:image {"id":704,"sizeSlug":"large","linkDestination":"media"} --> | ||
<figure class="wp-block-image size-large"><a href="http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1024x682.jpg"><img src="http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1024x682.jpg" alt="" class="wp-image-704"/></a></figure> | ||
<!-- /wp:image --> | ||
|
||
<!-- wp:image {"id":703,"sizeSlug":"large","linkDestination":"media"} --> | ||
<figure class="wp-block-image size-large"><a href="http://wptest.local/wp-content/uploads/2020/04/test-image-1024x683.jpg"><img src="http://wptest.local/wp-content/uploads/2020/04/test-image-1024x683.jpg" alt="" class="wp-image-703"/></a></figure> | ||
<!-- /wp:image --> | ||
</figure> | ||
<!-- /wp:gallery --> | ||
<!-- wp:gallery {"linkTo":"media"} --> | ||
<figure class="wp-block-gallery has-nested-images columns-default is-cropped"> | ||
<!-- wp:image {"id":705,"sizeSlug":"large","linkDestination":"media"} --> | ||
<figure class="wp-block-image size-large"><a href="http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1-682x1024.jpg"><img src="http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1-682x1024.jpg" alt="" class="wp-image-705"/></a></figure> | ||
<!-- /wp:image --> | ||
|
||
<!-- wp:image {"id":704,"sizeSlug":"large","linkDestination":"media"} --> | ||
<figure class="wp-block-image size-large"><a href="http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1024x682.jpg"><img src="http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1024x682.jpg" alt="" class="wp-image-704"/></a></figure> | ||
<!-- /wp:image --> | ||
|
||
<!-- wp:image {"id":703,"sizeSlug":"large","linkDestination":"media"} --> | ||
<figure class="wp-block-image size-large"><a href="http://wptest.local/wp-content/uploads/2020/04/test-image-1024x683.jpg"><img src="http://wptest.local/wp-content/uploads/2020/04/test-image-1024x683.jpg" alt="" class="wp-image-703"/></a></figure> | ||
<!-- /wp:image --> | ||
<figcaption class="blocks-gallery-caption">This gallery has a caption</figcaption> | ||
</figure> | ||
<!-- /wp:gallery --> |
120 changes: 120 additions & 0 deletions
120
test/integration/fixtures/blocks/core__gallery__deprecated-7.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
[ | ||
{ | ||
"name": "core/gallery", | ||
"isValid": true, | ||
"attributes": { | ||
"images": [], | ||
"ids": [], | ||
"shortCodeTransforms": [], | ||
"caption": "", | ||
"imageCrop": true, | ||
"fixedHeight": true, | ||
"linkTo": "media", | ||
"sizeSlug": "large", | ||
"allowResize": false | ||
}, | ||
"innerBlocks": [ | ||
{ | ||
"name": "core/image", | ||
"isValid": true, | ||
"attributes": { | ||
"url": "http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1-682x1024.jpg", | ||
"alt": "", | ||
"caption": "", | ||
"href": "http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1-682x1024.jpg", | ||
"id": 705, | ||
"sizeSlug": "large", | ||
"linkDestination": "media" | ||
}, | ||
"innerBlocks": [] | ||
}, | ||
{ | ||
"name": "core/image", | ||
"isValid": true, | ||
"attributes": { | ||
"url": "http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1024x682.jpg", | ||
"alt": "", | ||
"caption": "", | ||
"href": "http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1024x682.jpg", | ||
"id": 704, | ||
"sizeSlug": "large", | ||
"linkDestination": "media" | ||
}, | ||
"innerBlocks": [] | ||
}, | ||
{ | ||
"name": "core/image", | ||
"isValid": true, | ||
"attributes": { | ||
"url": "http://wptest.local/wp-content/uploads/2020/04/test-image-1024x683.jpg", | ||
"alt": "", | ||
"caption": "", | ||
"href": "http://wptest.local/wp-content/uploads/2020/04/test-image-1024x683.jpg", | ||
"id": 703, | ||
"sizeSlug": "large", | ||
"linkDestination": "media" | ||
}, | ||
"innerBlocks": [] | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "core/gallery", | ||
"isValid": true, | ||
"attributes": { | ||
"images": [], | ||
"ids": [], | ||
"shortCodeTransforms": [], | ||
"caption": "This gallery has a caption", | ||
"imageCrop": true, | ||
"fixedHeight": true, | ||
"linkTo": "media", | ||
"sizeSlug": "large", | ||
"allowResize": false | ||
}, | ||
"innerBlocks": [ | ||
{ | ||
"name": "core/image", | ||
"isValid": true, | ||
"attributes": { | ||
"url": "http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1-682x1024.jpg", | ||
"alt": "", | ||
"caption": "", | ||
"href": "http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1-682x1024.jpg", | ||
"id": 705, | ||
"sizeSlug": "large", | ||
"linkDestination": "media" | ||
}, | ||
"innerBlocks": [] | ||
}, | ||
{ | ||
"name": "core/image", | ||
"isValid": true, | ||
"attributes": { | ||
"url": "http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1024x682.jpg", | ||
"alt": "", | ||
"caption": "", | ||
"href": "http://wptest.local/wp-content/uploads/2020/09/test-image-edited-1024x682.jpg", | ||
"id": 704, | ||
"sizeSlug": "large", | ||
"linkDestination": "media" | ||
}, | ||
"innerBlocks": [] | ||
}, | ||
{ | ||
"name": "core/image", | ||
"isValid": true, | ||
"attributes": { | ||
"url": "http://wptest.local/wp-content/uploads/2020/04/test-image-1024x683.jpg", | ||
"alt": "", | ||
"caption": "", | ||
"href": "http://wptest.local/wp-content/uploads/2020/04/test-image-1024x683.jpg", | ||
"id": 703, | ||
"sizeSlug": "large", | ||
"linkDestination": "media" | ||
}, | ||
"innerBlocks": [] | ||
} | ||
] | ||
} | ||
] |
Oops, something went wrong.