<?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: Default Post Category AND Category Selection field form</title>
		<link>https://legacy.forums.gravityhelp.com/topic/default-post-category-and-category-selection-field-form</link>
		<description>Gravity Support Forums Topic: Default Post Category AND Category Selection field form</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 15:30:02 +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/default-post-category-and-category-selection-field-form" rel="self" type="application/rss+xml" />

		<item>
			<title>yoavadler on "Default Post Category AND Category Selection field form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/default-post-category-and-category-selection-field-form#post-24747</link>
			<pubDate>Tue, 03 May 2011 17:51:19 +0000</pubDate>
			<dc:creator>yoavadler</dc:creator>
			<guid isPermaLink="false">24747@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I was referring to C.Bliss code, but i already managed to use the filters methods written on functions.php file
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Default Post Category AND Category Selection field form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/default-post-category-and-category-selection-field-form#post-24638</link>
			<pubDate>Mon, 02 May 2011 12:19:22 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">24638@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;@yoavadler My example above didn't use any custom code.  So i'm not sure what you are referring to.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>yoavadler on "Default Post Category AND Category Selection field form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/default-post-category-and-category-selection-field-form#post-24619</link>
			<pubDate>Mon, 02 May 2011 07:58:26 +0000</pubDate>
			<dc:creator>yoavadler</dc:creator>
			<guid isPermaLink="false">24619@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Carl&#60;/p&#62;
&#60;p&#62;Just wanted to understand: the code you wrote should be in function.php&#60;/p&#62;
&#60;p&#62;Tnx&#60;br /&#62;
Yoav
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Bliss on "Default Post Category AND Category Selection field form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/default-post-category-and-category-selection-field-form#post-24522</link>
			<pubDate>Fri, 29 Apr 2011 13:08:26 +0000</pubDate>
			<dc:creator>Carl Bliss</dc:creator>
			<guid isPermaLink="false">24522@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Clever.&#60;/p&#62;
&#60;p&#62;Thanks Carl
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Default Post Category AND Category Selection field form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/default-post-category-and-category-selection-field-form#post-24520</link>
			<pubDate>Fri, 29 Apr 2011 13:05:48 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">24520@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;The default post category is only an option on the Post Title and Post Body fields if NO Post Category field exists ont he form.&#60;/p&#62;
&#60;p&#62;If you want to pre-define a default category AND have category selections then the solution is fairly simple.&#60;/p&#62;
&#60;p&#62;- Add a Post Category Field&#60;br /&#62;
- Edit the Post Category Field&#60;br /&#62;
- Select Selected Category and pick ONE category, the one you want to make the default&#60;br /&#62;
- Select the Advanced Tab&#60;br /&#62;
- Set the Visibility for this field to Admin Only&#60;/p&#62;
&#60;p&#62;Now when the form is submitted, even though that Post Category field is set to admin only it will still be executed and the single category you selected for that drop down field wil be populated.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Bliss on "Default Post Category AND Category Selection field form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/default-post-category-and-category-selection-field-form#post-24517</link>
			<pubDate>Fri, 29 Apr 2011 13:03:17 +0000</pubDate>
			<dc:creator>Carl Bliss</dc:creator>
			<guid isPermaLink="false">24517@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Great hooks and documentation!&#60;/p&#62;
&#60;p&#62;I wanted to post a solution to a process we are putting into place. I hope it helps someone!&#60;/p&#62;
&#60;p&#62;We are using a form to gather post submissions. We wanted the user to be able to select a category, but we also wanted to force submission into a particular category. When we add the category selection field to the form, the ability to add a default category is removed from the form options.&#60;/p&#62;
&#60;p&#62;This worked:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_post_data&#38;quot;, &#38;quot;change_cat&#38;quot;, 10, 2);
function change_cat($post_data, $form) {
	//Set the ID for the form you wish to execute this function
	$form_id = 1;
	//Set the ID for the Category you wish to
	$cat_id = 1;
	if($form[&#38;quot;id&#38;quot;]==$form_id) {
		array_push($post_data[post_category], $cat_id);
	}
	return $post_data;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;If you have another way to do this, I'd love to know!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
