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.

Use image field without creating a new post

  1. Hi!

    I created a form with a couple of fields and i used the image field type to upload images to my media library, but right now its creating a new post too, not just uploading the image to my media library. Is it possible to disable the post creation?

    Posted 7 years ago on Monday October 15, 2012 | Permalink
  2. http://www.gravityhelp.com/documentation/page/Gform_disable_post_creation

    Or, use a file upload field rather than a post field to allow image uploads.

    Posted 7 years ago on Monday October 15, 2012 | Permalink
  3. Thanks, gform_disable_post_creation did the trick!

    The problem with the file upload field is that its not storing the images in the media library. Maybe you could add an option for this in a future release:)

    Posted 7 years ago on Monday October 15, 2012 | Permalink
  4. Hm, sorry, its not working, because gform_disable_post_creation is also disable the attachment creation too:(

    Posted 7 years ago on Monday October 15, 2012 | Permalink
  5. So you're looking to upload images to the media gallery but not have them be attached to any posts, and not create any posts?

    Posted 7 years ago on Monday October 15, 2012 | Permalink
  6. That's exactly what I need too. I need it to be a clean image on the media library, to be attached later by a custom set of code.

    Posted 7 years ago on Tuesday October 16, 2012 | Permalink
  7. I suppose you could use the image upload post field, so the image goes into the media library, and then use the gform_after_submission to delete the post which was created? You could make the post status draft by default, so it could never be seen on the site, and a couple seconds later you delete it. http://www.gravityhelp.com/documentation/page/Gform_after_submission

    Posted 7 years ago on Tuesday October 16, 2012 | Permalink
  8. This could work, but this seems a little complicated solution. Also, if you're just using the image upload post field, you can't change the post status, its public by default.

    Posted 7 years ago on Tuesday October 16, 2012 | Permalink
  9. Good point. You could put a post body field in the form, so you can set the visibility to draft. It would not matter if it were draft or pending or published, really, since you are deleting the post immediately anyway, in a matter of a few seconds.

    To be clear, this is not the intention of the post image field. Post fields are intended to be used in posts. The fact that a post is being created is a side-effect of using a post image field. We're not trying to create posts here, but we want to use the post image field, so we need to come up with a workaround.

    If you did not use a post image field, there is probably a WordPress function to move the upload to the media library, but that may be more like starting over from scratch. Let us know if you need any more ideas.

    Posted 7 years ago on Tuesday October 16, 2012 | Permalink