Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
Plugin Name: bbPress - Custom subscribe all users to a forum
Plugin URI:
Description: bbPress - Custom subscribe all users to a forum
Version: 0.1
Author: Stephen Edgar - Netweb
Author URI:
// The forum ID
$forum_id = 43989;
// Get the array of ALL users
$users = get_users();
// Make sure it is a valid forum ID
$forum = bbp_get_forum( $forum_id );
if ( empty( $forum ) ) {
echo '<pre> Forum ID ' . $forum_id . ' is not valid</pre>';
return false;
// Loop through each usser and subscribe to the forum
foreach ( $users as $user ) {
bbp_add_user_forum_subscription( $user->ID, $forum_id );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.