| @@ -30,18 +30,12 @@ | ||
| 30 | 30 | $decoded_data['isGlobalStylesUserThemeJSON'] |
| 31 | 31 | ) { |
| 32 | 32 | unset( $decoded_data['isGlobalStylesUserThemeJSON'] ); |
| 33 | 33 | |
| 34 | - $data_to_encode = WP_Theme_JSON_Gutenberg::remove_insecure_properties( $decoded_data, 'custom' ); | |
| 34 | + $data_to_encode = WP_Theme_JSON_Gutenberg::remove_insecure_properties( $decoded_data ); | |
| 35 | 35 | |
| 36 | 36 | $data_to_encode['isGlobalStylesUserThemeJSON'] = true; |
| 37 | - /** | |
| 38 | - * JSON encode the data stored in post content. | |
| 39 | - * Escape characters that are likely to be mangled by HTML filters: "<>&". | |
| 40 | - * | |
| 41 | - * This matches the escaping in {@see WP_REST_Global_Styles_Controller_Gutenberg::prepare_item_for_database()}. | |
| 42 | - */ | |
| 43 | - return wp_slash( wp_json_encode( $data_to_encode, JSON_UNESCAPED_SLASHES | JSON_HEX_TAG | JSON_HEX_AMP ) ); | |
| 37 | + return wp_slash( wp_json_encode( $data_to_encode ) ); | |
| 44 | 38 | } |
| 45 | 39 | return $data; |
| 46 | 40 | } |
| 47 | 41 | |
| @@ -80,9 +74,8 @@ | ||
| 80 | 74 | * This function should not be backported to core. |
| 81 | 75 | * |
| 82 | 76 | * @param bool $allow_css Whether the CSS is allowed. |
| 83 | 77 | * @param string $css_test_string The CSS to test. |
| 84 | - * @return bool Whether the CSS is allowed. | |
| 85 | 78 | */ |
| 86 | 79 | function allow_filter_in_styles( $allow_css, $css_test_string ) { |
| 87 | 80 | if ( preg_match( |
| 88 | 81 | "/^filter:\s*url\((['\"]?)#wp-duotone-[-a-zA-Z0-9]+\\1\)(\s+!important)?$/", |
| @@ -93,18 +86,4 @@ | ||
| 93 | 86 | return $allow_css; |
| 94 | 87 | } |
| 95 | 88 | } |
| 96 | 89 | add_filter( 'safecss_filter_attr_allow_css', 'allow_filter_in_styles', 10, 2 ); |
| 97 | - | |
| 98 | -/** | |
| 99 | - * Update allowed inline style attributes list. | |
| 100 | - * | |
| 101 | - * @param string[] $attrs Array of allowed CSS attributes. | |
| 102 | - * @return string[] CSS attributes. | |
| 103 | - */ | |
| 104 | -function gutenberg_safe_grid_attrs( $attrs ) { | |
| 105 | - $attrs[] = 'grid-column'; | |
| 106 | - $attrs[] = 'grid-row'; | |
| 107 | - $attrs[] = 'container-type'; | |
| 108 | - return $attrs; | |
| 109 | -} | |
| 110 | -add_filter( 'safe_style_css', 'gutenberg_safe_grid_attrs' ); | |