Skip to content

Commit

Permalink
Fix a PHP Notice when render_block() is called without attributes. (#…
Browse files Browse the repository at this point in the history
…32135)

Co-authored-by: André <[email protected]>
  • Loading branch information
2 people authored and youknowriad committed May 31, 2021
1 parent d082191 commit 07eff92
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/block-supports/elements.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
* @return string Filtered block content.
*/
function gutenberg_render_elements_support( $block_content, $block ) {
$link_color = _wp_array_get( $block['attrs'], array( 'style', 'elements', 'link', 'color', 'text' ), null );
$link_color = null;
if ( ! empty( $block['attrs'] ) ) {
$link_color = _wp_array_get( $block['attrs'], array( 'style', 'elements', 'link', 'color', 'text' ), null );
}

/*
* For now we only care about link color.
Expand Down

0 comments on commit 07eff92

Please sign in to comment.