The following is a code snippet originally posted by Daniel McClure on GitHub as a Gist.
functions.php
“`
Original Gist
This file contains 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 | |
// Delete Gravity Form Entries for form ID 1 after submission. | |
// Switch action to `gform_after_submission` to target all forms. | |
add_action( 'gform_after_submission_1', 'remove_form_entry' ); | |
function remove_form_entry( $entry ) { | |
GFAPI::delete_entry( $entry['id'] ); | |
} |
Leave a Reply