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.

Pre-populate featured image field

  1. Hi there,

    I DON'T want to allow my users to upload an image, but rather want to preselect the post's featured image. Ideally, I want to use the value of a multi-select as the URL for the pre-selected image.

    Is there anyway I can achieve this with GF?

    Cheers, Lee

    Posted 9 years ago on Wednesday January 30, 2013 | Permalink
  2. Sure, this is possible.

    I think your select box can be the name of the image for the label, and the value can be the thumbnail ID, from the media manager. You need the thumbnail ID to use the WordPress function set_post_thumbnail

    Then, you could use the gform_after_submission hook to run the code to update set the post thumbnail (featured image) based on the form selection, which will have the thumbnail ID.

    Posted 9 years ago on Thursday January 31, 2013 | Permalink