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.

Image Manipulation

  1. Hi there,

    I am almost there with the form. There are just a couple of things that I need now.

    I have a timthumb script on the site and need to get the relative url of the uploaded image, like this /wp-content/uploads/gravity_forms/DSC_0223.jpg rather than http://example.com/wp-content/uploads/gravity_forms/DSC_0223.jpg

    The second thing that I need is once that image is uploaded, I need to insert the dimensions of the image into a custom field.

    Then the final thing is that I need to insert the relationship between this new post and what categories they have chosen via the dropdown.

    Please could you advise on this.

    Posted 13 years ago on Tuesday November 22, 2011 | Permalink
  2. By default it's only going to return the full path to the image. If you are running custom code you have written, you'll have to write code to trim the http://example.com from the URL and only return the content after that.

    If you need to insert the dimensions into a custom field, then add a Post Custom Field field for the dimensions (or 2 custom fields if you need width and height stored individually) and set the field type to hidden. Then when the form is submitted you'll have to write custom code to A) get the dimensions and B) update these field values with the dimensions.

    As for your category question, i'm not entirely sure why you can't use the built in tools to do this. There is a Post Category field when using Gravity Forms to create a post that automatically associated the post with the category selected. If you want them to select multiple categories, add multiple Post Category fields to your form.

    Posted 13 years ago on Tuesday November 22, 2011 | Permalink