Skip to content

Commit 02b8d7d

Browse files
authored
gpeb-process-feeds-on-edit.php: Added the ability to exclude certain feeds from being processed.
1 parent e667e03 commit 02b8d7d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

gp-entry-blocks/gpeb-process-feeds-on-edit.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
* Note, delayed feeds will still not be processed.
1010
*/
1111
add_filter( 'gform_entry_post_save', function( $entry, $form ) {
12+
// Array of feed ids to exclude for processing, if you want all feeds to be process use an empty array.
13+
$excluded_feed_ids = array( 103, 104 );
14+
1215
if ( ! function_exists( 'gp_entry_blocks' ) ) {
1316
return $entry;
1417
}
@@ -25,6 +28,14 @@
2528
$filter_priority = rand( 100000, 999999 );
2629
add_filter( 'gform_is_feed_asynchronous', '__return_false', $filter_priority );
2730

31+
add_filter( 'gform_addon_pre_process_feeds', function( $feeds, $entry, $form ) use ( $excluded_feed_ids ) {
32+
$feeds = array_filter( $feeds, function( $feed ) use ( $excluded_feed_ids ) {
33+
return ! in_array( $feed['id'], $excluded_feed_ids );
34+
} );
35+
36+
return $feeds;
37+
}, 10, 3 );
38+
2839
$addons = \GFAddon::get_registered_addons();
2940

3041
foreach ( $addons as $addon ) {
@@ -38,4 +49,3 @@
3849

3950
return $entry;
4051
}, 10, 2 );
41-

0 commit comments

Comments
 (0)