Last active
August 6, 2019 23:00
-
-
Save rafaehlers/ae5e5477486709046ae9d893a1331e18 to your computer and use it in GitHub Desktop.
Trigger form feeds on entry approval/disapproval
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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