mirror of
https://github.com/WordPress/WordPress.git
synced 2024-06-26 14:54:57 +02:00
Editor: Ensure block style name does not contain spaces before creating the class.
This change adds a check to ensure there is no spaces in block style variation names before generating the class. Returns `false` and a `_doing_it_wrong()` message if a space is detected. Props amustaque97, costdev, hellofromtonya, pbiron, SergeyBiryukov, afragen. Fixes #54296. Built from https://develop.svn.wordpress.org/trunk@52261 git-svn-id: http://core.svn.wordpress.org/trunk@51853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7290503480
commit
74d251884f
|
@ -62,6 +62,15 @@ final class WP_Block_Styles_Registry {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( str_contains( $style_properties['name'], ' ' ) ) {
|
||||||
|
_doing_it_wrong(
|
||||||
|
__METHOD__,
|
||||||
|
__( 'Block style name must not contain any spaces.' ),
|
||||||
|
'5.9.0'
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$block_style_name = $style_properties['name'];
|
$block_style_name = $style_properties['name'];
|
||||||
|
|
||||||
if ( ! isset( $this->registered_block_styles[ $block_name ] ) ) {
|
if ( ! isset( $this->registered_block_styles[ $block_name ] ) ) {
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.9-alpha-52260';
|
$wp_version = '5.9-alpha-52261';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user