Skip to content

Commit b7a1074

Browse files
authored
gcgs-process-feed-on-gravityflowformconnector-new-entry.php: Added snippet to process GCGS Feeds post Gravity Flow Form Connector New Entry.
1 parent bc265ff commit b7a1074

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
/**
3+
* Gravity Connect // Google Sheets // Process Feed when a New Entry is Created via Gravity Flow Form Connector.
4+
*
5+
* Instruction Video: https://www.loom.com/share/7c5b3b5e286648538bf4a2326333f4d7
6+
*
7+
* Process Google Sheet feeds when a new entry is created.
8+
*/
9+
add_action( 'gravityflowformconnector_post_new_entry', function ( $new_entry_id, $entry, $form, $step ) {
10+
if ( function_exists( 'gc_google_sheets' ) && $step->get_type() == 'new_entry' ) {
11+
$new_entry = GFAPI::get_entry( $new_entry_id );
12+
$new_form = GFAPI::get_form( $new_entry['form_id'] );
13+
gc_google_sheets()->maybe_process_feed( $new_entry, $new_form );
14+
gf_feed_processor()->save()->dispatch();
15+
}
16+
}, 10, 4 );

0 commit comments

Comments
 (0)