-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Block Library: Add 'object-position' to allowed inline style attributes list #30243
Block Library: Add 'object-position' to allowed inline style attributes list #30243
Conversation
Core trac ticket: https://core.trac.wordpress.org/ticket/52961. |
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.
LGTM 👍
Note: When this gets merged backported to core, object-position
should simply be added in the array of allowed attributes inside the safecss_filter_attr
function instead.
Thanks, @aristath, for the review.
Right, I also create PR for it WordPress/wordpress-develop#1156. My question is if we should keep fallback in the plugin while supporting a non backported core version. |
Awesome 👍
I'd say yes. The Gutenberg plugin needs to support previous versions of WP and not just the latest one, so this will need to be there. if ( ! in_array( 'object-option', $attrs ) ) {
$attrs[] = 'object-position';
} or instead of |
2307e11
to
ed3d1ca
Compare
Agree. Added note about removal. I'll merge this if it's okay with you. |
Thank you :)
Agreed |
Changes are merged into the core. Changeset https://core.trac.wordpress.org/changeset/50649 |
Description
The
object-position
property, used by the Cover block, isn't in the list of allowed CSS attributes. It's removed from the content when non-admin users save a post.Fixes #29907.
How has this been tested?
Types of changes
Bugfix
Checklist: