Commit b3be9ceffe for wordpress.org
commit b3be9ceffe18f296e1fead9192ac9d2066a401f0
Author: isabel_brison <isabel_brison@git.wordpress.org>
Date: Mon Nov 2 23:09:56 2026 +0000
Editor: allow CSS custom properties in block gap values.
Ensures wp_sanitize_block_gap_value allows custom property strings so they can applied in responsive grid layout calculations.
Props noruzzaman.
Fixes #66427.
Built from https://develop.svn.wordpress.org/trunk@65212
git-svn-id: http://core.svn.wordpress.org/trunk@64361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-includes/block-supports/layout.php b/wp-includes/block-supports/layout.php
index 208cd42090..855b01764d 100644
--- a/wp-includes/block-supports/layout.php
+++ b/wp-includes/block-supports/layout.php
@@ -112,6 +112,11 @@ function wp_sanitize_block_gap_value( $gap_value ) {
return null;
}
+ // Allow valid CSS custom property references, e.g. var(--wp--preset--spacing--32).
+ if ( preg_match( '/^var\(--[a-zA-Z0-9_-]+\)$/', $gap_value ) ) {
+ return $gap_value;
+ }
+
return $gap_value && preg_match( '%[\\\(&=}]|/\*%', $gap_value ) ? null : $gap_value;
}
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 8c2c1f8ec4..0a8d6fec65 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.2-beta3-65211';
+$wp_version = '7.2-beta3-65212';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.