From b49b215f7b5682f61b42058349095449e089d17a Mon Sep 17 00:00:00 2001 From: Jorge Costa Date: Mon, 8 Nov 2021 09:49:31 +0000 Subject: [PATCH] Centralize safe_style_css usages. (#36280) --- lib/compat.php | 1 + lib/global-styles.php | 13 ------------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/lib/compat.php b/lib/compat.php index 917d22fe733704..8d1f908161870e 100644 --- a/lib/compat.php +++ b/lib/compat.php @@ -186,6 +186,7 @@ function gutenberg_safe_style_attrs( $attrs ) { $attrs[] = 'border-top-right-radius'; $attrs[] = 'border-bottom-right-radius'; $attrs[] = 'border-bottom-left-radius'; + $attrs[] = 'filter'; return $attrs; } diff --git a/lib/global-styles.php b/lib/global-styles.php index ec1c83281a4314..ddcba56c2eec0f 100644 --- a/lib/global-styles.php +++ b/lib/global-styles.php @@ -215,7 +215,6 @@ function gutenberg_global_styles_filter_post( $content ) { */ function gutenberg_global_styles_kses_init_filters() { add_filter( 'content_save_pre', 'gutenberg_global_styles_filter_post' ); - add_filter( 'safe_style_css', 'gutenberg_global_styles_include_support_for_duotone', 10, 2 ); } /** @@ -289,18 +288,6 @@ function gutenberg_global_styles_include_support_for_wp_variables( $allow_css, $ return ! ! preg_match( '/^var\(--wp-[a-zA-Z0-9\-]+\)$/', trim( $parts[1] ) ); } -/** - * This is for using kses to test user data. - * - * @param array $atts Allowed CSS property names, according to kses. - * - * @return array The new allowed CSS property names. - */ -function gutenberg_global_styles_include_support_for_duotone( $atts ) { - $atts[] = 'filter'; - return $atts; -} - // The else clause can be removed when plugin support requires WordPress 5.8.0+. if ( function_exists( 'get_block_editor_settings' ) ) { add_filter( 'block_editor_settings_all', 'gutenberg_experimental_global_styles_settings', PHP_INT_MAX );