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.

Form to create new post type in multisite install

  1. jcollier
    Member

    To extend this now-closed thread ...

    http://forum.gravityhelp.com/topic/add-a-form-to-create-a-new-custom-post-type

    How do I reference a form ID for just one site within a 3.01 multisite installation?

    Posted 14 years ago on Wednesday October 13, 2010 | Permalink
  2. To use the gform_post_data filter for a specific form you would append the form id to that filter call. For example:

    Instead of this:

    add_filter("gform_post_data", "change_post_data", 10, 2);

    You would do this:

    add_filter("gform_post_data_5", "change_post_data", 10, 2);

    The 5 in the example above (gform_post_data_5) is the form id.

    Now keep in mind that when doing this if you add this to a theme that is shared by other sites then it's going to fire for form id 5 on that site also. You would have to wrap it all in an if statement to see if the site id in the multi-site install is a specific id to force it only to do so on a specific site in a multisite install.

    Posted 14 years ago on Wednesday October 13, 2010 | Permalink
  3. jcollier
    Member

    Yes, exactly. It is the if statement (wrapping the form ID) that I was looking for, since form 1 is in use in multiple sites.

    Posted 14 years ago on Wednesday October 13, 2010 | Permalink