<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Gravity Forms Archives - Web321: Your Best WordPress Support</title>
	<atom:link href="https://web321.co/tag/gravity-forms/feed/" rel="self" type="application/rss+xml" />
	<link>https://web321.co/tag/gravity-forms/</link>
	<description>Your WordPress Website Maintenance Experts</description>
	<lastBuildDate>Fri, 10 Feb 2023 17:32:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://web321.co/wp-content/uploads/2022/04/cropped-favicon-32x32.png</url>
	<title>Gravity Forms Archives - Web321: Your Best WordPress Support</title>
	<link>https://web321.co/tag/gravity-forms/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Linking Gravity Forms to BuddyPress Forums</title>
		<link>https://web321.co/linking-gravity-forms-to-buddypress-forums/</link>
		
		<dc:creator><![CDATA[Shawn DeWolfe]]></dc:creator>
		<pubDate>Tue, 31 Jan 2023 18:04:52 +0000</pubDate>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Buddypress]]></category>
		<category><![CDATA[Gravity Forms]]></category>
		<guid isPermaLink="false">https://web321.co/?p=55064</guid>

					<description><![CDATA[<p>I was posed with problem: make BuddyPress forum topics from a Gravity Forms form submission. Turning Gravity Form submissions into posts isn&#8217;t a big party trick&#8211; that is built in. What doesn&#8217;t work, is the linkage to a particular forum as a new topic. So: I did some hacking (see the code below). I made [&#8230;]</p>
<p>The post <a href="https://web321.co/linking-gravity-forms-to-buddypress-forums/">Linking Gravity Forms to BuddyPress Forums</a> appeared first on <a href="https://web321.co">Web321: Your Best WordPress Support</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I was posed with problem: make BuddyPress forum topics from a Gravity Forms form submission. Turning Gravity Form submissions into posts isn&#8217;t a big party trick&#8211; that is built in. What doesn&#8217;t work, is the linkage to a particular forum as a new topic. So: I did some hacking (see the code below).</p>
<ul>
<li>I made a gravity form</li>
<li>I have it posting to the post_type for topics</li>
<li>I put in a hidden value with the label of &#8220;forum_id&#8221; and the number for that forum id as the default value for the hidden value</li>
<li>I had an existing plugin that was mine. I added the code below to listen for Gravity Form events and then act on the submission.</li>
<li>WordPress will do the submission, save the post, then go to this function to act and create linkage between the form submission and a forum.</li>
</ul>
<pre>// publish and associate the form

function sboxr_application_submission( $entry, $form ) {
	if (function_exists('bbp_update_forum')) {
	    //getting post
    	$post = get_post( $entry['post_id'] );

	    //changing post content
	    foreach ($form['fields'] as $key =&gt; $values) {
    		if ($values['label'] == 'forum_id') {
    			$post-&gt;post_parent = $values['defaultValue'];
    			break;
    		}   
	    }

		$forum_meta = array(
			'forum_id' =&gt; $post-&gt;post_parent,
			'topic_id' =&gt; $post-&gt;ID,		
			'comment_status' =&gt; 'open'
		);
		$post-&gt;comment_status = 'open';	
		$post-&gt;post_status = 'publish';

		bbp_update_forum(array('forum_id' =&gt; $post-&gt;post_parent));
	    //updating post
		wp_update_post($post);
	
		foreach ( $forum_meta as $meta_key =&gt; $meta_value ) {
			update_post_meta( $post-&gt;ID, '_bbp_' . $meta_key, $meta_value );
		}	
	}
}

// Hook to make the gravity form submission to connect to forum post creation
add_action( 'gform_after_submission_2', 'sboxr_application_submission', 10, 2 );
</pre>
<p>The post <a href="https://web321.co/linking-gravity-forms-to-buddypress-forums/">Linking Gravity Forms to BuddyPress Forums</a> appeared first on <a href="https://web321.co">Web321: Your Best WordPress Support</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
