/** * Creates a new forum inside a specific BuddyPress group. * * Uses the bundled version of bbPress packaged with BuddyPress. * * @since BuddyPress (1.0.0) * * @param int $group_id The group ID that the new forum should be attached to. * @param string $group_name The group name. * @param string $group_desc The group description. */ function groups_new_group_forum($group_id = 0, $group_name = '', $group_desc = '') { if (empty($group_id)) { $group_id = bp_get_current_group_id(); } if (empty($group_name)) { $group_name = bp_get_current_group_name(); } if (empty($group_desc)) { $group_desc = bp_get_current_group_description(); } $forum_id = bp_forums_new_forum(array('forum_name' => $group_name, 'forum_desc' => $group_desc)); groups_update_groupmeta($group_id, 'forum_id', $forum_id); do_action('groups_new_group_forum', $forum_id, $group_id); }
/** * Creates a new forum inside a specific BuddyPress group. * * Uses the bundled version of bbPress packaged with BuddyPress. * * @since BuddyPress (1.0.0) * * @param int $group_id The group ID that the new forum should be attached to. * @param string $group_name The group name. * @param string $group_desc The group description. */ function groups_new_group_forum($group_id = 0, $group_name = '', $group_desc = '') { if (empty($group_id)) { $group_id = bp_get_current_group_id(); } if (empty($group_name)) { $group_name = bp_get_current_group_name(); } if (empty($group_desc)) { $group_desc = bp_get_current_group_description(); } $forum_id = bp_forums_new_forum(array('forum_name' => $group_name, 'forum_desc' => $group_desc)); groups_update_groupmeta($group_id, 'forum_id', $forum_id); /** * Fires after the creation of a new forum inside a specific BuddyPress group. * * @since BuddyPress (1.0.0) * * @param int $forum_id ID of the newly created forum. * @param int $group_id ID of the associated group. */ do_action('groups_new_group_forum', $forum_id, $group_id); }
/** * Echoes the output of bp_get_current_group_description(). * * @since 2.1.0 */ function bp_current_group_description() { echo bp_get_current_group_description(); }