Skip to content

Commit

Permalink
fix undefined index notice in Social Link Block (#25663)
Browse files Browse the repository at this point in the history
* fix undefined index notice

* use isset instead of array_key_exists check

* Update packages/block-library/src/social-link/index.php

Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl>

Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl>
  • Loading branch information
fabiankaegy and gziolo authored Nov 9, 2020
1 parent 6d475af commit e7f722c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-library/src/social-link/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @return string Rendered HTML of the referenced block.
*/
function render_block_core_social_link( $attributes, $content, $block ) {
$open_in_new_tab = $block->context['openInNewTab'];
$open_in_new_tab = isset( $block->context['openInNewTab'] ) ? $block->context['openInNewTab'] : false;

$service = ( isset( $attributes['service'] ) ) ? $attributes['service'] : 'Icon';
$url = ( isset( $attributes['url'] ) ) ? $attributes['url'] : false;
Expand Down

0 comments on commit e7f722c

Please sign in to comment.