Skip to content

Commit 9726320

Browse files
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
1 parent 7cf8998 commit 9726320

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wp-includes/block-supports/background.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function wp_register_background_support( $block_type ) {
4848
*/
4949
function wp_render_background_support( $block_content, $block ) {
5050
$block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] );
51-
$block_attributes = $block['attrs'];
51+
$block_attributes = ( isset( $block['attrs'] ) && is_array( $block['attrs'] ) ) ? $block['attrs'] : array();
5252
$has_background_image_support = block_has_support( $block_type, array( 'background', 'backgroundImage' ), false );
5353

5454
if (

0 commit comments

Comments
 (0)