bbp_update_forum_id( int $post_id, int $forum_id )

Update a posts forum meta ID

Description

Parameters

$post_id

(int) (Required) The post to update

$forum_id

(int) (Required) The forum

Source

File: bp-forums/core/functions.php

function bbp_update_forum_id( $post_id, $forum_id ) {

	// Allow the forum ID to be updated 'just in time' before save
	$forum_id = apply_filters( 'bbp_update_forum_id', $forum_id, $post_id );

	// Update the post meta forum ID
	update_post_meta( $post_id, '_bbp_forum_id', (int) $forum_id );
}

Changelog

Changelog
Version Description
bbPress (r3181) Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.