Skip to content

Instantly share code, notes, and snippets.

@rafaehlers
Last active February 6, 2025 17:34
Show Gist options
  • Save rafaehlers/e0473ed42df119315932d32d3d0a7b5a to your computer and use it in GitHub Desktop.
Save rafaehlers/e0473ed42df119315932d32d3d0a7b5a to your computer and use it in GitHub Desktop.
Trigger a PayPal add-on feed after editing an entry
<?php // DO NOT COPY THIS LINE
add_action( 'gravityview/edit_entry/after_update', 'gravityview_trigger_paypal_feeds', 10, 3 );
function gravityview_trigger_paypal_feeds( $form = array(), $entry_id = array(), $object ) {
if ( 100 !== (int) $form['id'] ) { // replace 100 with your form ID
return;
}
add_filter( 'gform_is_feed_asynchronous', '__return_false', 1294873 );
if( class_exists('GF_PPCP') ) {
$PayPal = GF_PPCP::get_instance();
$PayPal->maybe_process_feed( $object->entry, $form );
}
remove_filter( 'gform_is_feed_asynchronous', '__return_false', 1294873 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment