Hi GF
I am looking for solution to allow a gravity form to dynamically pull in the featured image of a post the same way it can pull in the post title.
Basically this is a form on a products website. On the product details page is a modal with an enquiry form in it (a gravity form). I need it that when the user opens the modal with the form, two fields need to populate automatically - the post title and the featured image. We have the post title working, but cannot get the image to display.
We tried something like this:
add_filter('gform_field_value_prodimage', 'populate_post_prodimage');
function populate_post_prodimage($value){
global $post;
$prodimg = set_post_thumbnail($entry['post_id']);
return $prodimg;
}
But it doesn't appear to be working.
Any suggestion?