Skip to content

Commit

Permalink
Background support: Backport fix for undefined array key (#54850)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewserong authored Sep 27, 2023
1 parent 2823ea0 commit dfb5420
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/block-supports/background.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function gutenberg_register_background_support( $block_type ) {
*/
function gutenberg_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 (
Expand Down

0 comments on commit dfb5420

Please sign in to comment.