<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: Add the Featured Image of a Post to a Gravity Form on that page</title>
		<link>https://legacy.forums.gravityhelp.com/topic/add-the-featured-image-of-a-post-to-a-gravity-form-on-that-page</link>
		<description>Gravity Support Forums Topic: Add the Featured Image of a Post to a Gravity Form on that page</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 20:26:54 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/add-the-featured-image-of-a-post-to-a-gravity-form-on-that-page" rel="self" type="application/rss+xml" />

		<item>
			<title>stankobrin on "Add the Featured Image of a Post to a Gravity Form on that page"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/add-the-featured-image-of-a-post-to-a-gravity-form-on-that-page#post-261498</link>
			<pubDate>Sun, 19 May 2013 13:48:42 +0000</pubDate>
			<dc:creator>stankobrin</dc:creator>
			<guid isPermaLink="false">261498@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;In case anyone else trying to find a solution, i finally managed to hack this solution:&#60;/p&#62;
&#60;p&#62;add_filter('gform_field_choices', 'update_choices', 10, 2);&#60;br /&#62;
function update_choices($choice_html, $field){&#60;/p&#62;
&#60;p&#62;    if($field['formId'] != 3)&#60;br /&#62;
        return $choice_html;&#60;/p&#62;
&#60;p&#62;    if($field['id'] == 21) {&#60;br /&#62;
        // in this example, &#34;First Choice&#34; is one of the option labels, we replace that with the image&#60;br /&#62;
        // the reason we include the &#34;&#38;gt;&#38;lt;&#34; when searching for the &#34;First Choice&#34; text is because unless&#60;br /&#62;
        // the 'enable values' option is selected for this field, it would replace both the value and&#60;br /&#62;
        // the label, we just want to update the label&#60;/p&#62;
&#60;p&#62;		global $post;&#60;br /&#62;
    	$feat1 = '&#38;lt;img src=&#34;';&#60;br /&#62;
		$feat2 = wp_get_attachment_url( get_post_thumbnail_id($post-&#38;gt;ID) );&#60;br /&#62;
		$feat3 = '&#34; width=&#34;250&#34; height=&#34;220&#34; /&#38;gt;';&#60;br /&#62;
		$featimage = $feat1 . $feat2 . $feat3;&#60;br /&#62;
		return $featimage;&#60;br /&#62;
    }
&#60;/p&#62;</description>
		</item>
		<item>
			<title>stankobrin on "Add the Featured Image of a Post to a Gravity Form on that page"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/add-the-featured-image-of-a-post-to-a-gravity-form-on-that-page#post-249131</link>
			<pubDate>Sun, 12 May 2013 12:06:16 +0000</pubDate>
			<dc:creator>stankobrin</dc:creator>
			<guid isPermaLink="false">249131@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;OK i have change the code to the get_the_post_thumbnail but now how do i pull that into an image field / checkbox on the form?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Add the Featured Image of a Post to a Gravity Form on that page"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/add-the-featured-image-of-a-post-to-a-gravity-form-on-that-page#post-169700</link>
			<pubDate>Wed, 13 Mar 2013 07:27:31 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">169700@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Why are you using 'set_post_thumbail' here, if you are trying to retrieve what is saved as the featured image?  How about get_the_post_thumbnail &#60;a href=&#34;http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail&#34; rel=&#34;nofollow&#34;&#62;http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>stankobrin on "Add the Featured Image of a Post to a Gravity Form on that page"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/add-the-featured-image-of-a-post-to-a-gravity-form-on-that-page#post-166678</link>
			<pubDate>Sun, 10 Mar 2013 10:19:48 +0000</pubDate>
			<dc:creator>stankobrin</dc:creator>
			<guid isPermaLink="false">166678@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi GF&#60;/p&#62;
&#60;p&#62;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.&#60;/p&#62;
&#60;p&#62;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.&#60;/p&#62;
&#60;p&#62;We tried something like this:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;#39;gform_field_value_prodimage&#38;#39;, &#38;#39;populate_post_prodimage&#38;#39;);
function populate_post_prodimage($value){
    global $post;

    $prodimg = set_post_thumbnail($entry[&#38;#39;post_id&#38;#39;]);

    return $prodimg;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;But it doesn't appear to be working.&#60;/p&#62;
&#60;p&#62;Any suggestion?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
