diff --git a/src/wp-includes/kses.php b/src/wp-includes/kses.php index 157be6be119f1..5766beb92fb29 100644 --- a/src/wp-includes/kses.php +++ b/src/wp-includes/kses.php @@ -2277,6 +2277,7 @@ function kses_init() { * nested `var()` values, and assigning values to CSS variables. * Added support for `object-fit`, `gap`, `column-gap`, `row-gap`, and `flex-wrap`. * Extended `margin-*` and `padding-*` support for logical properties. + * @since 6.2.0 Added support for `position`, `top`, `right`, `bottom`, `left` and `z-index` position CSS properties. * * @param string $css A string of CSS rules. * @param string $deprecated Not used. @@ -2438,6 +2439,13 @@ function safecss_filter_attr( $css, $deprecated = '' ) { 'overflow', 'vertical-align', + 'position', + 'top', + 'right', + 'bottom', + 'left', + 'z-index', + // Custom CSS properties. '--*', ) diff --git a/tests/phpunit/tests/kses.php b/tests/phpunit/tests/kses.php index b31f477661d8c..32edc4df5618d 100644 --- a/tests/phpunit/tests/kses.php +++ b/tests/phpunit/tests/kses.php @@ -1278,6 +1278,11 @@ public function data_test_safecss_filter_attr() { 'css' => '--?><.%-not-allowed: red;', 'expected' => '', ), + // Position properties introduced in 6.2. + array( + 'css' => 'position: sticky;top: 0;left: 0;right: 0;bottom: 0;z-index: 10;', + 'expected' => 'position: sticky;top: 0;left: 0;right: 0;bottom: 0;z-index: 10', + ), ); }