<?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: Form submission &#38; Buddypress</title>
		<link>https://legacy.forums.gravityhelp.com/topic/form-submission-buddypress</link>
		<description>Gravity Support Forums Topic: Form submission &amp; Buddypress</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 03:10:59 +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/form-submission-buddypress" rel="self" type="application/rss+xml" />

		<item>
			<title>David Smith on "Form submission &#38; Buddypress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/form-submission-buddypress#post-42367</link>
			<pubDate>Mon, 28 Nov 2011 19:28:17 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">42367@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Fozzybear,&#60;/p&#62;
&#60;p&#62;So the category ID is populating the field specified correctly; however, the created post is not automatically assigned that category?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>fozzybear on "Form submission &#38; Buddypress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/form-submission-buddypress#post-39695</link>
			<pubDate>Wed, 02 Nov 2011 12:29:54 +0000</pubDate>
			<dc:creator>fozzybear</dc:creator>
			<guid isPermaLink="false">39695@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Apologies for a shameless bump
&#60;/p&#62;</description>
		</item>
		<item>
			<title>fozzybear on "Form submission &#38; Buddypress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/form-submission-buddypress#post-39571</link>
			<pubDate>Tue, 01 Nov 2011 15:32:58 +0000</pubDate>
			<dc:creator>fozzybear</dc:creator>
			<guid isPermaLink="false">39571@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I have now created a test page and embedded the form on this (did this originally but not with later changes) to remove the BP aspect altogether.&#60;/p&#62;
&#60;p&#62;I can see that the value is being passed to the field that I have set as a simple string but I don't see how the form control as any relationship to a WP post category or how the form action is being constructed this simple page name / slug is returning the user to the BP members directory instead of simply  doing a '/'&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;&#38;lt;form id=&#38;quot;gform_4&#38;quot; action=&#38;quot;/test-gf-post-page/&#38;quot; enctype=&#38;quot;multipart/form-data&#38;quot; method=&#38;quot;post&#38;quot;&#38;gt;
&#38;lt;div class=&#38;quot;gform_heading&#38;quot;&#38;gt;
&#38;lt;div class=&#38;quot;gform_body&#38;quot;&#38;gt;
&#38;lt;ul id=&#38;quot;gform_fields_4&#38;quot; class=&#38;quot;gform_fields top_label description_below&#38;quot;&#38;gt;
&#38;lt;li id=&#38;quot;field_4_1&#38;quot; class=&#38;quot;gfield&#38;quot;&#38;gt;
&#38;lt;li id=&#38;quot;field_4_2&#38;quot; class=&#38;quot;gfield&#38;quot;&#38;gt;
&#38;lt;li id=&#38;quot;field_4_5&#38;quot; class=&#38;quot;gfield&#38;quot;&#38;gt;
&#38;lt;label class=&#38;quot;gfield_label&#38;quot; for=&#38;quot;input_4_5&#38;quot;&#38;gt;Post Tags&#38;lt;/label&#38;gt;
&#38;lt;div class=&#38;quot;ginput_container&#38;quot;&#38;gt;
&#38;lt;/li&#38;gt;
&#38;lt;li id=&#38;quot;field_4_6&#38;quot; class=&#38;quot;gfield field_admin_only&#38;quot;&#38;gt;
&#38;lt;input id=&#38;quot;input_4_6&#38;quot; class=&#38;quot;gform_hidden&#38;quot; type=&#38;quot;hidden&#38;quot; value=&#38;quot;All Saints School&#38;quot; name=&#38;quot;input_6&#38;quot;&#38;gt;
&#38;lt;/li&#38;gt;
&#38;lt;/ul&#38;gt;
&#38;lt;/div&#38;gt;
&#38;lt;div class=&#38;quot;gform_footer top_label&#38;quot;&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I set the 'Post Category' to admin only for this test but either way I appear to get same results?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>fozzybear on "Form submission &#38; Buddypress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/form-submission-buddypress#post-39549</link>
			<pubDate>Tue, 01 Nov 2011 13:47:55 +0000</pubDate>
			<dc:creator>fozzybear</dc:creator>
			<guid isPermaLink="false">39549@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Well sadly I have tried every way I can think of , changed the form parameter to 'category' moved the add_action around, tried taking the form out of the other plugins function, even tried a simple string to return matching to an existing post category to rule out any issues with the variable even though it's good, but each post that gets aded as a draft is always of category 'uncategorized'&#60;/p&#62;
&#60;p&#62;So completely stumped now :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>fozzybear on "Form submission &#38; Buddypress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/form-submission-buddypress#post-39536</link>
			<pubDate>Tue, 01 Nov 2011 11:44:06 +0000</pubDate>
			<dc:creator>fozzybear</dc:creator>
			<guid isPermaLink="false">39536@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Ah I had tried the above but I hadn't set the form dynamic parameter to 'category' I had assumed that this would be 'group_slug' so I will give that a try the only other thing that does confuse me is where this function should run inside of the other plugins function that holds the GF form or outside that function both positions being in functions.php but I guess that's one of those trial and error questions :)&#60;/p&#62;
&#60;p&#62;Thanks for the help, I shall report back on success or fail.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Form submission &#38; Buddypress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/form-submission-buddypress#post-39530</link>
			<pubDate>Tue, 01 Nov 2011 11:03:31 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">39530@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Fozzybear,&#60;/p&#62;
&#60;p&#62;Assuming that the $group_slug is indeed a global variable (per your example above), you could populate a field with it's value like so:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[php]
add_filter(&#38;quot;gform_field_value_category&#38;quot;, &#38;quot;add_field_value&#38;quot;);
function add_field_value($value){
    global $group_slug;
    return $group_slug;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;This assumes that there is a field on the form with the dynamic population parameter set to &#34;category&#34;.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>fozzybear on "Form submission &#38; Buddypress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/form-submission-buddypress#post-39470</link>
			<pubDate>Mon, 31 Oct 2011 17:42:25 +0000</pubDate>
			<dc:creator>fozzybear</dc:creator>
			<guid isPermaLink="false">39470@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks Carl, appreciate it.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Form submission &#38; Buddypress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/form-submission-buddypress#post-39428</link>
			<pubDate>Mon, 31 Oct 2011 14:46:48 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">39428@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;David is out today, but I will forward this to him so he can assist you with it.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>fozzybear on "Form submission &#38; Buddypress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/form-submission-buddypress#post-39398</link>
			<pubDate>Mon, 31 Oct 2011 09:45:13 +0000</pubDate>
			<dc:creator>fozzybear</dc:creator>
			<guid isPermaLink="false">39398@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I apologise for bringing this back up but I'm getting stumped on trying to pass a value to the form despite trying a few variations,&#60;/p&#62;
&#60;p&#62;Currently this is the working form:&#60;br /&#62;
primary page runs this function:&#60;br /&#62;
&#60;code&#62;bcg_get_post_form(bp_get_group_id());&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;it grabs the function in functions.php:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function rh_student_form($cats,$url){

global $group_slug;
echo $group_slug; // this variable is valid

//$cats is arra of category ids associated with this group
//url is the url of current page

gravity_form(4, true, true, false, &#38;#39;&#38;#39;, false);
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;In this sense the form works fine  -ish it's displayed and will submit albeit re-freshing back to the members directory but this I think is an issue with the complicated way BP creates urls and root components.&#60;/p&#62;
&#60;p&#62;What I can't work out is how to pass $group_slug to the GF form category field to pre-populate it or simply populate it as group_slug is dependent on the group  id being viewed at that time so isn't fixed. I tried the suggestion earlier  and have set the form to take a parameter tried as '$group_slug' &#38;amp; 'group_slug'&#60;/p&#62;
&#60;p&#62;The snippet I'm working with is:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_field_value_category&#38;quot;, &#38;quot;add_field_value&#38;quot;);
function add_field_value($group_slug){

    return $group_slug;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;This I have tried in functions.php and actually within the function above 'rh_student_form'&#60;/p&#62;
&#60;p&#62;But no joy. I realise that what I have doesn't remotely feel like it ought to work but even checking a few other posts where you mention 'create_function'? in the add_action I'm failing to see how to accomplish this or really what to try next.&#60;/p&#62;
&#60;p&#62;Help / further guidance would be greatly appreciated.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>fozzybear on "Form submission &#38; Buddypress"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/form-submission-buddypress#post-39304</link>
			<pubDate>Sat, 29 Oct 2011 10:11:11 +0000</pubDate>
			<dc:creator>fozzybear</dc:creator>
			<guid isPermaLink="false">39304@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks David, unfortunately I did read the docs on hooks before and again  as you linked to above but I'm not able to pass through even a simple string via a filter, but then I don't really find anything intuitive or easy about WP filters and hooks, theory is great, using  is intimidating :)
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
