<?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: Embed form on single.php and pre-populating fields</title>
		<link>https://legacy.forums.gravityhelp.com/topic/embed-form-on-singlephp-and-pre-populating-fields</link>
		<description>Gravity Support Forums Topic: Embed form on single.php and pre-populating fields</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 22:52:26 +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/embed-form-on-singlephp-and-pre-populating-fields" rel="self" type="application/rss+xml" />

		<item>
			<title>Jan Egbert on "Embed form on single.php and pre-populating fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/embed-form-on-singlephp-and-pre-populating-fields#post-2250</link>
			<pubDate>Sat, 19 Dec 2009 06:50:20 +0000</pubDate>
			<dc:creator>Jan Egbert</dc:creator>
			<guid isPermaLink="false">2250@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks Alex, thanks Carl,&#60;/p&#62;
&#60;p&#62;Gravity Forms opens up a complete new world to me. I'm actually learning PHP. I'm waking up at night, thinking &#34;Hey, I could do that and that... oh and that also&#34;.&#60;/p&#62;
&#60;p&#62;For example I use Gravity Forms for a client who thinks WordPress admin is too complex. I did everything to make the interface simpler, but nothing helped. When I introduced a front end login + redirect to a Gravity Forms form, this client was overjoyed. I mean: anyone can fill out a form.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Embed form on single.php and pre-populating fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/embed-form-on-singlephp-and-pre-populating-fields#post-2190</link>
			<pubDate>Wed, 16 Dec 2009 14:07:29 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">2190@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Good stuff Jan, you figured it out.&#60;br /&#62;
You could use the following if you want your code a bit cleaner:&#60;br /&#62;
&#60;code&#62;&#60;br /&#62;
add_filter('gform_field_value_reactionsubject', 'populate_reactionsubject');&#60;br /&#62;
function populate_reactionsubject() {&#60;br /&#62;
  global $post;&#60;br /&#62;
  return 'Reaction to ' . $post-&#38;gt;post_title;&#60;br /&#62;
}&#60;br /&#62;
&#60;/code&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Embed form on single.php and pre-populating fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/embed-form-on-singlephp-and-pre-populating-fields#post-2188</link>
			<pubDate>Wed, 16 Dec 2009 12:48:32 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">2188@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;LOL Glad you got it figured out Jan.  I had forwarded it to Alex to get back with you on, but you figured it out before that happened.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Jan Egbert on "Embed form on single.php and pre-populating fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/embed-form-on-singlephp-and-pre-populating-fields#post-2187</link>
			<pubDate>Wed, 16 Dec 2009 11:42:45 +0000</pubDate>
			<dc:creator>Jan Egbert</dc:creator>
			<guid isPermaLink="false">2187@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I got it to work.. there is probably some cleaner or easier way, but this seems to work fine.&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;#39;gform_field_value_reactionsubject&#38;#39;, &#38;#39;populate_reactionsubject&#38;#39;);
function populate_reactionsubject() {
global $post;
$reactiontitle = ($post-&#38;gt;post_title);
$reactionsubject = &#38;#39;Reaction to &#38;#39; . sprintf( $reactiontitle) . &#38;#39;&#38;#39;;
return $reactionsubject;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I also added pre-population of the email field.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;#39;gform_field_value_reactionemail&#38;#39;, &#38;#39;populate_reactionemail&#38;#39;);
function populate_reactionemail(){
if ( is_user_logged_in() ) {
 global $userdata;
	return $userdata-&#38;gt;user_email;
}
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;This forum is great for talking to myself without feeling ashamed about it.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Jan Egbert on "Embed form on single.php and pre-populating fields"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/embed-form-on-singlephp-and-pre-populating-fields#post-2183</link>
			<pubDate>Wed, 16 Dec 2009 07:38:23 +0000</pubDate>
			<dc:creator>Jan Egbert</dc:creator>
			<guid isPermaLink="false">2183@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;This is what I already got working after searching this wonderful forum.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;/**
* Put form with ID 2 in single.php
*/
add_action( &#38;#39;hybrid_after_entry&#38;#39;, &#38;#39;email_advertiser&#38;#39;, 11);
function email_advertiser() {
if ( is_single() &#38;amp;&#38;amp; in_category(&#38;#39;Marketplace&#38;#39;) ) {
	gravity_form(2, false, false);
	}
}
/**
* Change notifacation routing in order to attach post author emailadress to the form
*
*/
add_filter( &#38;#39;gform_notification_email_2&#38;#39;, &#38;#39;route_notification&#38;#39;, 10, 2 );
function route_notification($email_to, $entry){
	global $post;
	$email_to = get_the_author_email();
	return $email_to;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Now what I want is to pre-populate the Subject field with Reaction to + the post title.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;#39;gform_field_value_reactionsubject&#38;#39;, &#38;#39;populate_reactionsubject&#38;#39;);
function populate_reactionsubject() {
global $post;
return ($post-&#38;gt;post_title);
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;How do I put 'Reaction to' before post title? I tried  to echo it, but that just makes it appear above the form.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
