2
votes

I am trying to disable the entry creation for a gravity form I have on my WordPress website. The form consists of username/password for another application (not WordPress) and I do not want it to list/create entries in the WordPress database every time this form is used. I have a dashboard widget also which displays all forms in the website as well as all the entries of each. I am trying to find a way to either hide the form entirely from the widget or not create entries at all.

I tried the following hook,thinking it would stop creating entries.



    add_filter("gform_disable_post_creation", "disable_post_creation", 10, 3);
       function disable_post_creation($is_disabled, $form, $entry){
       return true;
    }


But this isn't working. Does anyone know of a way I can hide the form or disable entry creation for this specific form?

1

1 Answers

3
votes

While you can’t currently prevent Gravity Forms from creating an entry, you can get the same desired outcome by automatically deleting the entry after the form has finished submitting using the gform_after_submission_{$form['id']} action hook and the Gravity Forms API.

Here's a full tutorial on how to do it manually (disclaimer: I wrote it):

https://gravityplus.pro/how-to/prevent-gravity-forms-entry-creation/

That tutorial also has a link to the plugin I wrote that allows you to simply check a box on the Form Settings page to prevent entry creation and everything is handled for you.