Editor: fix undefined array key warning.

Checks if `attrs` array key exists before using its value.

Props mukesh27, kafleg.
Fixes #59468.


git-svn-id: https://develop.svn.wordpress.org/trunk@56731 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Isabel Brison
2023-09-27 05:10:28 +00:00
parent 7cf8998e46
commit 972632085f
@@ -48,7 +48,7 @@ function wp_register_background_support( $block_type ) {
*/
function wp_render_background_support( $block_content, $block ) {
$block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] );
$block_attributes = $block['attrs'];
$block_attributes = ( isset( $block['attrs'] ) && is_array( $block['attrs'] ) ) ? $block['attrs'] : array();
$has_background_image_support = block_has_support( $block_type, array( 'background', 'backgroundImage' ), false );
if (