Skip to content

Commit

Permalink
Add 'object-position' to allowed inline style attributes list (#30243)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka authored Apr 2, 2021
1 parent c508c1b commit 4b557cb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,18 @@ function gutenberg_override_reusable_block_post_type_labels() {
);
}
add_filter( 'post_type_labels_wp_block', 'gutenberg_override_reusable_block_post_type_labels', 10, 0 );

/**
* Update allowed inline style attributes list.
*
* Note: This should be removed when the minimum required WP version is >= 5.8.
*
* @param string[] $attrs Array of allowed CSS attributes.
* @return string[] CSS attributes.
*/
function gutenberg_safe_style_attrs( $attrs ) {
$attrs[] = 'object-position';

return $attrs;
}
add_filter( 'safe_style_css', 'gutenberg_safe_style_attrs' );

0 comments on commit 4b557cb

Please sign in to comment.