Editor: Check that `attrs` is an array in `WP_Block_Supports::apply_block_supports()`.

This prevents a fatal error in `wp_apply_custom_classname_support()`, which expects an array data type for block attributes, and makes sure the block editor can still load if there is a mistake in the attributes of a block.

Follow-up to [54498].

Props caercam.
Fixes #61151.
Built from https://develop.svn.wordpress.org/trunk@58112


git-svn-id: http://core.svn.wordpress.org/trunk@57577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2024-05-06 21:25:15 +00:00
parent 558b8897e6
commit 97c3f24034
2 changed files with 2 additions and 2 deletions

View File

@ -103,7 +103,7 @@ class WP_Block_Supports {
return array();
}
$block_attributes = array_key_exists( 'attrs', self::$block_to_render )
$block_attributes = array_key_exists( 'attrs', self::$block_to_render ) && is_array( self::$block_to_render['attrs'] )
? self::$block_to_render['attrs']
: array();

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.6-alpha-58111';
$wp_version = '6.6-alpha-58112';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.