Gallery shortcodes unexpectedly show as carousels by default in Transitional/Standard mode #4774
Labels
Bug
Something isn't working
Changelogged
Whether the issue/PR has been added to release notes.
Embeds
Groomed
Integration: WP Core
Needs sizing
P0
High priority
WS:Core
Work stream for Plugin core
Milestone
Bug Description
When a site has galleries in Classic blocks, these are always getting displayed as carousels unless the author goes into the code editor and adds
amp-carousel=false
to the[gallery]
shortcodes. This was done back at a time before the block editor existed and at a time in which the gallery block styles couldn't be rendered in Reader mode safely. Both of these are no longer the case, however. As of #4204 via #4299, core block styles are now enqueued in the classic post templates.For sites in Standard/Transitional mode, the Shortcode block was augmented to inject
amp-carousel=false
into the block behind the scenes, while also exposing a new carousel toggle in the block settings. (This was not being done for shortcodes in Classic blocks however.) In hindsight, this seems irrelevant because when a Classic block is converted to blocks, thegallery
shortcodes are not converted into Shortcode blocks but rather Gallery blocks. Therefore, all that logic to extend the Shortcode block in the block editor should just be removed.👉 The
gallery
shortcode should not display as a carousel in Standard/Transitional mode unless explicitly requested via theamp-carousel=true
shortcode attribute.Also, it may make sense for the Gallery block to keep the carousel enabled by default when in Reader mode. Nevertheless, when the
[gallery]
shortcode does haveamp-carousel=false
, we should make sure that the required gallery styles are enqueued in classic Reader mode (or else create such basic styles).Reported in support forum topic.
Expected Behaviour
Steps to reproduce
Screenshots
Editor
Non-AMP ✅
AMP Reader Mode ✅
AMP Transitional mode ❌
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation brief
QA testing instructions
Demo
Changelog entry
The text was updated successfully, but these errors were encountered: