PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Multi site Word Press and wanting to use gform_disable_post_creation

  1. Hi,
    I would like to use the gform_disable_post_creation in my functions.php to not allow certain forms to post into the database. These forms go to another application and I use the Pass Field Data Via Query String so there is no need to store the entries.
    The problem is that we use Multisite and the same template for each site. If I place the code in and another site is using the same ID number with their form, (that might need the submits to be registered into the database) it will stop that from occurring.

    Is there a shortcode that can be used per form to disable the creation, or is there a way in the function.php to specify the form, like the name of the form instead of the ID?

    I was going to try the switch_to_blog(); but I am not sure that is the best solution.

    Thanks for your time.

    Posted 11 years ago on Wednesday January 9, 2013 | Permalink
  2. Are you trying to disable the creation of the post, or the storing of the entry? gform_disable_post_creation will prevent the form from creating a WordPress Post. But from the rest of your description, it sounds like you just want to prevent storing the entry, since you are already dealing with the submitted data using the query string?

    Posted 11 years ago on Wednesday January 9, 2013 | Permalink
  3. Yes, that is what I want to do, not allow the storing of the entry. So the disable post creation is different...

    Is there a way not to allow the storing?

    Thanks for your help.

    Posted 11 years ago on Wednesday January 9, 2013 | Permalink
  4. You cannot prevent the storage of the entry, but you can delete it immediately after it's stored if you want. Please see this topic for the explanation of how to do that:

    http://www.gravityhelp.com/forums/topic/purposefully-not-save-form-in-entries-database#post-15601

    Posted 11 years ago on Wednesday January 9, 2013 | Permalink
  5. Thank You. One more question. I read the post you gave me should work, however I am concerned that the site is a multisite using the same template. Is there a way to specify which site the form is from or do I need to do the switchblog() code in order to be more specific to which form I need to remove the entries?

    Thanks,

    Posted 11 years ago on Wednesday January 9, 2013 | Permalink
  6. I'm not sure exactly how it would work in a multi-site installation. Can you post the code you are going to use at pastebin.com or pastie.org and I will see about making sure it runs only on the entries for the blog in question.

    Posted 11 years ago on Thursday January 10, 2013 | Permalink