From eecf7a11ba0fb6e5e24d4452222f67a3dfa70369 Mon Sep 17 00:00:00 2001 From: Siddharth Thevaril Date: Mon, 15 Jul 2024 00:33:32 +0530 Subject: [PATCH] fix undefined array key "id" --- includes/classes/DistributorPost.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/classes/DistributorPost.php b/includes/classes/DistributorPost.php index 17d1d5eb3..fef6d0c18 100644 --- a/includes/classes/DistributorPost.php +++ b/includes/classes/DistributorPost.php @@ -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;