-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Allow longhand and shorthand properties in theme.json
and block attributes
#31641
Changes from all commits
945356b
265a812
e7f0c7c
114c3d7
4cdeee1
6a2a1a1
aafe091
c6c5595
9b8f2c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -182,6 +182,10 @@ function gutenberg_override_reusable_block_post_type_labels() { | |
*/ | ||
function gutenberg_safe_style_attrs( $attrs ) { | ||
$attrs[] = 'object-position'; | ||
$attrs[] = 'border-top-left-radius'; | ||
$attrs[] = 'border-top-right-radius'; | ||
$attrs[] = 'border-bottom-right-radius'; | ||
$attrs[] = 'border-bottom-left-radius'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was this change backported to Core at any point? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It appears to me that the changes were backported and were done so in (WordPress/wordpress-develop@f034bc8). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Part of my confusion is that the function indicates that it should be removed once the minimum WP version is 5.8, I guess it should have been updated to 5.9 after this change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That was an oversight of mine sorry. This change didn't make it into a release until 11.0 and therefore WP 5.9. An additional attribute was added to this filter a few months later (#36280) that would also make the minimum version requirement 5.9 before it can be removed. I've created a tiny PR to fix this comment in #38359. |
||
|
||
return $attrs; | ||
} | ||
|
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.
Can the border radius be
null
? Do we need to check for that like we do for spacing?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.
I believe the original code here for the border support was added prior to
_wp_array_get
getting wider usage so the code approaches the check a little differently to the spacing support.Along with checking for the feature support, it also does an
isset
check which would return false for a null value. Would making the supports' code consistent in approach be best done in a separate PR? I'm happy to take care of that in a follow up.