You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WordPress 5.7 the Cover block now makes use of a regular img element instead of a background-image. See dev note:
As of #25171, the cover block now uses an img element instead of using CSSbackground-image for images that are not using fixed or repeated backgrounds. This means that, when rendering the post, a srcset attribute will be applied with the various generated image sizes, saving bandwidth by loading smaller images when possible.
This impacts the DetermineHeroImages transformer which I recall was built to account for background images only. Right now I see a cover block's wrapper div is getting the data-hero attribute as opposed to the contained amp-img:
Bug Description
WordPress 5.7 the Cover block now makes use of a regular
img
element instead of abackground-image
. See dev note:This impacts the
DetermineHeroImages
transformer which I recall was built to account for background images only. Right now I see a cover block's wrapperdiv
is getting thedata-hero
attribute as opposed to the containedamp-img
:The XPath is selecting the wrapper
div
rather than the.wp-block-cover__image-background
element:amp-wp/src/Transformer/DetermineHeroImages.php
Lines 54 to 59 in 7429a18
Expected Behaviour
The
amp-img
in a Cover block should get thedata-hero
attribute.Steps to reproduce
data-hero
attribute is not added to theamp-img
in the Cover block.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: