Skip to content

Commit

Permalink
Merge pull request #1247 from 10up/fix/warning-array-id
Browse files Browse the repository at this point in the history
fix/warning:  Undefined array key "id"
  • Loading branch information
peterwilsoncc authored Jul 22, 2024
2 parents 61331d1 + eecf7a1 commit 3a45cb9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion includes/classes/DistributorPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,11 @@ protected function parse_blocks_for_attachment_id( $block ) {
}

if ( in_array( $block['blockName'], $block_names, true ) ) {
$media[] = $block['attrs'][ $media_blocks[ $block['blockName'] ] ];
$attribute_key = $media_blocks[ $block['blockName'] ];

if ( isset( $block['attrs'][ $attribute_key ] ) ) {
$media[] = $block['attrs'][ $attribute_key ];
}
}

return $media;
Expand Down

0 comments on commit 3a45cb9

Please sign in to comment.