<?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: Using gform_post_submission and usermeta</title>
		<link>https://legacy.forums.gravityhelp.com/topic/using-gform_post_submission-and-usermeta</link>
		<description>Gravity Support Forums Topic: Using gform_post_submission and usermeta</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 12:02:21 +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/using-gform_post_submission-and-usermeta" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Using gform_post_submission and usermeta"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/using-gform_post_submission-and-usermeta#post-34345</link>
			<pubDate>Sat, 03 Sep 2011 11:34:51 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">34345@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Outstanding.  Glad you were able to resolve that.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>billerickson on "Using gform_post_submission and usermeta"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/using-gform_post_submission-and-usermeta#post-34334</link>
			<pubDate>Sat, 03 Sep 2011 09:00:14 +0000</pubDate>
			<dc:creator>billerickson</dc:creator>
			<guid isPermaLink="false">34334@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Ah, sending the term ID instead of slug did it! &#60;/p&#62;
&#60;p&#62;Of course now I just went to the Codex to add that useful piece of information and it's already on there. &#60;/p&#62;
&#60;p&#62;Thanks for helping me troubleshoot this.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Using gform_post_submission and usermeta"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/using-gform_post_submission-and-usermeta#post-34314</link>
			<pubDate>Sat, 03 Sep 2011 00:18:22 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">34314@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;It appears that you're using the hook correctly and it makes sense to me.&#60;/p&#62;
&#60;p&#62;Should &#60;strong&#62;array ($gender)&#60;/strong&#62; just be $gender, since it's just a string, not an array?  Have you already tried it like that?  Or should an array of just one string work just as well?&#60;/p&#62;
&#60;p&#62;Other troubleshooting ideas I had:&#60;br /&#62;
If you dump the $data object, what does it look like?&#60;/p&#62;
&#60;p&#62;What does wp_set_post_terms return (can you check the value?)&#60;/p&#62;
&#60;p&#62;Is the taxonomy hierarchical? (I'm guessing it's not, but I think hierarchical ones need to be passed in by ID not $string to eliminate ambiguity.)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>billerickson on "Using gform_post_submission and usermeta"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/using-gform_post_submission-and-usermeta#post-34296</link>
			<pubDate>Fri, 02 Sep 2011 19:23:34 +0000</pubDate>
			<dc:creator>billerickson</dc:creator>
			<guid isPermaLink="false">34296@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I must be using this hook incorrectly, but I can't figure out how to fix it. I have two forms: one for registered users (id=1) and one for non-registered users (id=3).  &#60;/p&#62;
&#60;p&#62;For form #3, I'm using the Gravity Forms + Custom Post Type plugin to add a dropdown field connected to a taxonomy called Gender. This way the non-registered user can select their gender and it is associated with the post.&#60;/p&#62;
&#60;p&#62;Registered users already have gender attached to usermeta (added during signup). When a registered user fills out form #1 I want it to use their usermeta to set the gender taxonomy.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;#39;gform_post_submission_1&#38;#39;, &#38;#39;be_add_gender&#38;#39;, 10, 2);
function be_add_gender($entry, $form){
		$data = wp_get_current_user();
		$gender = ( &#38;#39;male&#38;#39; == $data-&#38;gt;gender ) ? &#38;#39;male&#38;#39; : &#38;#39;female&#38;#39;;
		wp_set_post_terms( $entry[&#38;#39;post_id&#38;#39;],  array( $gender ), &#38;#39;gender&#38;#39; );
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Even if my usermeta isn't set, $gender defaults to female and it should be placing the post in the 'female' term of the 'gender' taxonomy. When a post is published, no taxonomy terms are selected.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
