Skip to content

Instantly share code, notes, and snippets.

@rafaehlers
Last active August 6, 2019 23:00
Show Gist options
  • Save rafaehlers/ae5e5477486709046ae9d893a1331e18 to your computer and use it in GitHub Desktop.
Save rafaehlers/ae5e5477486709046ae9d893a1331e18 to your computer and use it in GitHub Desktop.
Trigger form feeds on entry approval/disapproval
<?php // DON'T COPY THIS LINE
//add_action('gravityview/approve_entries/disapproved','gv_trigger_form_feed_on_approval');
add_action('gravityview/approve_entries/approved','gv_trigger_form_feed_on_approval');
function gv_send_form_notification_approval($entry_id = 0){
$entry = GFAPI::get_entry( $entry_id );
if( ! $entry || is_wp_error( $entry ) ) {
return;
}
$form = GFAPI::get_form( $entry['form_id'] );
if( ! $form || is_wp_error( $form ) ) {
return;
}
gf_do_action( array( 'gform_after_submission', $form['id'] ), $entry, $form );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment