Skip to content

Commit

Permalink
fix undefined array key "id"
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidsector9 committed Jul 14, 2024
1 parent 10fafaf commit eecf7a1
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 eecf7a1

Please sign in to comment.