<?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: Hook Syntax Help</title>
		<link>https://legacy.forums.gravityhelp.com/topic/hook-syntax-help</link>
		<description>Gravity Support Forums Topic: Hook Syntax Help</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 11:02:28 +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/hook-syntax-help" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Hook Syntax Help"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/hook-syntax-help#post-154561</link>
			<pubDate>Mon, 25 Feb 2013 23:18:53 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">154561@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You should be using &#60;strong&#62;return&#60;/strong&#62; rather than &#60;strong&#62;echo&#60;/strong&#62; on line 4, otherwise your function won't return anything.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Andy on "Hook Syntax Help"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/hook-syntax-help#post-154201</link>
			<pubDate>Mon, 25 Feb 2013 11:28:08 +0000</pubDate>
			<dc:creator>Andy</dc:creator>
			<guid isPermaLink="false">154201@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;i have used:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;#39;gform_field_value_page_name&#38;#39;, &#38;#39;page_name_filler&#38;#39;);
	function page_name_filler($value){
            //this is where you&#38;#39;d put your PHP code for grabbing the current post title.
	    echo get_the_title(); //return the variable or value to the field.
	}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;but nothing gets returned.. is my syntax wrong?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Andy on "Hook Syntax Help"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/hook-syntax-help#post-152451</link>
			<pubDate>Fri, 22 Feb 2013 15:26:35 +0000</pubDate>
			<dc:creator>Andy</dc:creator>
			<guid isPermaLink="false">152451@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;thanks David, but don't i need to specify the form ID and the field ID anywhere? ??
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Hook Syntax Help"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/hook-syntax-help#post-152337</link>
			<pubDate>Fri, 22 Feb 2013 11:02:11 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">152337@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;pre&#62;&#60;code&#62;add_filter(&#38;#39;gform_field_value_page_name&#38;#39;, &#38;#39;page_name_filler&#38;#39;);
	function page_name_filler($value){
            //this is where you&#38;#39;d put your PHP code for grabbing the current post title.
	    return &#38;#39;boom!&#38;#39;; //return the variable or value to the field.
	}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>Andy on "Hook Syntax Help"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/hook-syntax-help#post-152323</link>
			<pubDate>Fri, 22 Feb 2013 10:45:48 +0000</pubDate>
			<dc:creator>Andy</dc:creator>
			<guid isPermaLink="false">152323@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;Could you please help me with the correct syntax for using the hook.&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;1	add_filter(&#38;#39;gform_field_value_your_parameter&#38;#39;, &#38;#39;my_custom_population_function&#38;#39;);
2	function my_custom_population_function($value){
3	    return &#38;#39;boom!&#38;#39;;
4	}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;My form ID is 15, field_ID 11 and parameter name: page_name&#60;/p&#62;
&#60;p&#62;I would like to always return the current post title in the page_name parameter &#60;/p&#62;
&#60;p&#62;I have already setup this up to populate dynamically.&#60;/p&#62;
&#60;p&#62;many thanks,&#60;br /&#62;
Andy
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
