Gravity Form – Create BBPress Topic In Specific Forum


I’m wanting to use Gravity Forms to create a new BBPress topic.

With the Gravity Form + Custom Post type plugin, I can make Gravity Form create a forum topic. It is , however; unassigned to a forum.

I have done some hunting and found this code that basically forces any unassigned forum post to a specific forum. This is great if you want to use one form to most post into one forum.

I’d like to create multiple Gravity Forms and have them post to different bbpress forms. Is this possible?

`add_action( ‘gform_after_submission’, ‘set_post_content’, 10, 2 );

function set_post_content( $entry, $form ) {

//set the forum ID that the topic will be saved to

$forum_ID = ‘31086’ ;

if (!function_exists(‘bbp_insert_topic’:wink:) {

require_once ‘/includes/topics/functions.php’;


//getting post

$post_form = get_post($entry) ;

$title = $post_form->post_title;

$content = $post_form->post_content;

// The topic data.

$topic_data = array(

‘post_parent’ => $forum_ID, // forum ID of Projects hard coded

‘post_status’ => bbp_get_public_status_id(), // Subscribed users can see this

‘post_content’ => $content,

‘post_title’ => $title,

‘comment_status’ => ‘open’,

‘menu_order’ => 0


// The topic meta.

$topic_meta = array(

‘forum_id’ => $forum_ID,

‘reply_count’ => 0


$post_id = bbp_insert_topic($topic_data, $topic_meta);