-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cover: Update background type when using featured image #40873
Conversation
Size Change: +12 B (0%) Total Size: 1.23 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes the problem. I tested and just setting the correct backgrount type solves the issue, why do we need to set id and url to undefined?
@draganescu, I don’t think we need to keep them if the block doesn’t use those attributes. |
I cherry-picked this PR for WordPress 6.0 RC2 with 9e782ed. |
What?
Resolves #40871.
PR fixes the issue when the cover block displays video on the front end even after selecting the "Use featured image" option.
Why?
The featured image toggle action didn't update the
backgroundType
attribute, and therender_callback
only changes the block content for the image background type.I understand this action is meant to be "non-destructive," but the block generates incompatible markup for the render callback without this change.
Users can use the "undo" functionality to restore the original state of the block.
How?
Updates
toggleUseFeaturedImage
callback to rest required attributes.Testing Instructions