Skip to content

Commit

Permalink
Add isset() check to avoid Undefined array key Warning (#37101)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkaz committed Dec 6, 2021
1 parent 93393d0 commit 1404987
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/block-supports/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function gutenberg_render_layout_support_flag( $block_content, $block ) {
$id = uniqid();
$style = gutenberg_get_layout_style( ".wp-container-$id", $used_layout, $has_block_gap_support );
$container_class = 'wp-container-' . $id . ' ';
$justify_class = $used_layout['justifyContent'] ? 'wp-justify-' . $used_layout['justifyContent'] . ' ' : '';
$justify_class = isset( $used_layout['justifyContent'] ) ? 'wp-justify-' . $used_layout['justifyContent'] . ' ' : '';
// This assumes the hook only applies to blocks with a single wrapper.
// I think this is a reasonable limitation for that particular hook.
$content = preg_replace(
Expand Down

0 comments on commit 1404987

Please sign in to comment.