From 6527b6e28ecb9e2b3c5f2980bb7f291ebc967cbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Maneiro?= <583546+oandregal@users.noreply.github.com> Date: Fri, 4 Aug 2023 15:27:29 +0200 Subject: [PATCH] get_root_layout_rules: remove unnecessary call to sanitize_title The layout definitions are static and defined by the code, so there is no need to sanitize them. --- lib/class-wp-theme-json-gutenberg.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/class-wp-theme-json-gutenberg.php b/lib/class-wp-theme-json-gutenberg.php index 97b9c58b13df29..874edf492ee024 100644 --- a/lib/class-wp-theme-json-gutenberg.php +++ b/lib/class-wp-theme-json-gutenberg.php @@ -1317,7 +1317,7 @@ protected function get_layout_styles( $block_metadata ) { continue; } - $class_name = sanitize_title( _wp_array_get( $layout_definition, array( 'className' ), false ) ); + $class_name = _wp_array_get( $layout_definition, array( 'className' ), false ); $spacing_rules = _wp_array_get( $layout_definition, array( 'spacingStyles' ), array() ); if ( @@ -1374,7 +1374,7 @@ protected function get_layout_styles( $block_metadata ) { ) { $valid_display_modes = array( 'block', 'flex', 'grid' ); foreach ( $layout_definitions as $layout_definition ) { - $class_name = sanitize_title( _wp_array_get( $layout_definition, array( 'className' ), false ) ); + $class_name = _wp_array_get( $layout_definition, array( 'className' ), false ); $base_style_rules = _wp_array_get( $layout_definition, array( 'baseStyles' ), array() ); if (