From bb324461a1da05d848b2fc86874db73888341082 Mon Sep 17 00:00:00 2001 From: Saif Sultan Date: Tue, 18 Mar 2025 11:53:26 +0530 Subject: [PATCH] `gpeb-process-feeds-on-edit.php`: Fixed an issue with the snippet causing fatal error. --- gp-entry-blocks/gpeb-process-feeds-on-edit.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gp-entry-blocks/gpeb-process-feeds-on-edit.php b/gp-entry-blocks/gpeb-process-feeds-on-edit.php index f5ee6a5b8..26eb7cb3b 100644 --- a/gp-entry-blocks/gpeb-process-feeds-on-edit.php +++ b/gp-entry-blocks/gpeb-process-feeds-on-edit.php @@ -29,6 +29,12 @@ add_filter( 'gform_is_feed_asynchronous', '__return_false', $filter_priority ); add_filter( 'gform_addon_pre_process_feeds', function( $feeds, $entry, $form ) use ( $excluded_feed_ids ) { + // If no feeds are present, return. + if ( ! is_array( $feeds ) ) { + return $feeds; + } + + // Filter feeds excluding the ones in the excluded feed ids array. $feeds = array_filter( $feeds, function( $feed ) use ( $excluded_feed_ids ) { return ! in_array( $feed['id'], $excluded_feed_ids ); } );