From 7e5abd8d7edc7bbff33a2310b6e48491c85735c8 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Thu, 21 Oct 2021 15:30:04 +0200 Subject: [PATCH 1/2] Prevent PHP notice from block-supports elements --- lib/block-supports/elements.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/block-supports/elements.php b/lib/block-supports/elements.php index 880ee1afa3baf2..98ef9ee5a3fc68 100644 --- a/lib/block-supports/elements.php +++ b/lib/block-supports/elements.php @@ -13,6 +13,11 @@ * @return string Filtered block content. */ function gutenberg_render_elements_support( $block_content, $block ) { + + if ( ! $block_content ) { + return; + } + $link_color = null; if ( ! empty( $block['attrs'] ) ) { $link_color = _wp_array_get( $block['attrs'], array( 'style', 'elements', 'link', 'color', 'text' ), null ); From 94ea82824b3a76dd17260ddfd9a77133df90ee23 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Fri, 22 Oct 2021 07:44:03 +0200 Subject: [PATCH 2/2] Update lib/block-supports/elements.php Co-authored-by: George Mamadashvili --- lib/block-supports/elements.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/block-supports/elements.php b/lib/block-supports/elements.php index 98ef9ee5a3fc68..f3b7891f107d60 100644 --- a/lib/block-supports/elements.php +++ b/lib/block-supports/elements.php @@ -15,7 +15,7 @@ function gutenberg_render_elements_support( $block_content, $block ) { if ( ! $block_content ) { - return; + return $block_content; } $link_color = null;