Skip to content

Commit

Permalink
Return early if there's no source and url
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewserong committed Jan 9, 2024
1 parent 185ee76 commit c2982a3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/wp-includes/block-supports/background.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ function wp_render_background_support( $block_content, $block ) {
$background_image_url = isset( $block_attributes['style']['background']['backgroundImage']['url'] )
? $block_attributes['style']['background']['backgroundImage']['url']
: null;

if ( ! $background_image_source && ! $background_image_url ) {
return $block_content;
}

$background_size = isset( $block_attributes['style']['background']['backgroundSize'] )
? $block_attributes['style']['background']['backgroundSize']
: 'cover';
Expand Down

0 comments on commit c2982a3

Please sign in to comment.