Skip to content

Instantly share code, notes, and snippets.

@danielmcclure
Created November 20, 2018 00:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielmcclure/b89d8ce1f7ab9aa3d9d26ac79dae02f2 to your computer and use it in GitHub Desktop.
Save danielmcclure/b89d8ce1f7ab9aa3d9d26ac79dae02f2 to your computer and use it in GitHub Desktop.
Delete Gravity Form Entries After Submission
<?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'] );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment