Loads Group Extension for Forums Component

since 2.1.0 bbPress (r3552)
package bbPress
subpackage BuddyPress

 Methods

Setup bbPress group extension variables

__construct() 
since 2.1.0 bbPress (r3552)

Show forums and new forum form when creating a group

create_screen($group_id = 0
since 2.0.0 bbPress (r3465)

Parameters

$group_id

Save the Group Forum data on create

create_screen_save($group_id = 0
since 2.0.0 bbPress (r3465)

Parameters

$group_id

Listening to BuddyPress Group deletion to remove the forum

disconnect_forum_from_group(integer $group_id = 0
since 2.3.0 bbPress (r4815)

Parameters

$group_id

integer

The group ID

The primary display function for group forums

display(integer $group_id = null
since 2.1.0 bbPress (r3746)

Parameters

$group_id

integer

ID of the current group. Available only on BP 2.2+.

Output the forums for a group in the edit screens

display_forums($offset = 0

As of right now, bbPress only supports 1-to-1 group forum relationships. In the future, many-to-many should be allowed.

since 2.1.0 bbPress (r3653)

Parameters

$offset

Redirect to the group admin forum edit screen

edit_redirect_to($redirect_url = ''
since 2.1.0 bbPress (r3653)

Parameters

$redirect_url

Show forums and new forum form when editing a group

edit_screen(object $group = false
since 2.1.0 bbPress (r3563)

Parameters

$group

object

(the group to edit if in Group Admin UI)

Save the Group Forum data on edit

edit_screen_save(integer $group_id = 0
since 2.0.0 bbPress (r3465)

Parameters

$group_id

integer

(to handle Group Admin UI hook bp_group_admin_edit_after )

Permissions to view the 'New Topic'/'Reply To' form in a BuddyPress group.

form_permissions(boolean $retval = false) : boolean
since 2.3.0 bbPress (r4608)

Parameters

$retval

boolean

Are we allowed to view the reply form?

Returns

boolean

Make Forum Parent a hidden field instead of a selectable one.

forum_parent() 
since 2.1.0 bbPress (r3746)

Displays the bbPress meta-box in BuddyPress Group Admin UI

group_admin_ui_display_metabox(object $item) 
since 2.3.0 bbPress (r4814)

Parameters

$item

object

(group object)

Adds a meta-box to BuddyPress Group Admin UI

group_admin_ui_edit_screen() 
since 2.3.0 bbPress (r4814)

Add a hidden input field on the group settings page if the group forum is enabled.

group_settings_hidden_field() 

Due to the way BuddyPress' group admin settings page saves its settings, we need to let BP know that bbPress added a forum.

since 2.4.0 bbPress (r5026)
link https://bbpress.trac.wordpress.org/ticket/2339/
see

Ensure that bbp_is_single_forum() returns true on group forum pages.

is_single_forum(boolean $retval = false) : boolean
see
since 2.6.0 bbPress (r6366)

Parameters

$retval

boolean

Current boolean.

Returns

boolean

Ensure that bbp_is_single_topic() returns true on group forum topic pages.

is_single_topic(boolean $retval = false) : boolean
see
since 2.6.0 bbPress (r6220)

Parameters

$retval

boolean

Current boolean.

Returns

boolean

Map a forum post to its corresponding group in the group activity stream.

map_activity_to_group(array $args = array()) : array
since 2.2.0 bbPress (r4396)

Parameters

$args

array

Arguments from BBP_BuddyPress_Activity::record_activity()

Returns

array

Allow group members to have advanced privileges in group forum topics.

map_group_forum_meta_caps(array $caps = array(), string $cap = '', integer $user_id = 0, array $args = array()) : array
since 2.2.0 bbPress (r4434)

Parameters

$caps

array

$cap

string

$user_id

integer

$args

array

Returns

array

Map a reply edit link to its group forum

map_reply_edit_url_to_group(string $url, integer $reply_id) : string
since 2.2.0 bbPress (r4266)

Parameters

$url

string

$reply_id

integer

Returns

string

Maybe unset the group forum nav item if group does not have a forum

maybe_unset_forum_menu() : \If
since 2.3.0 bbPress (r4552)

Returns

\Ifnot viewing a single group

Creating a group forum or category (including root for group)

new_forum(array $forum_args = array()) : void
since 2.1.0 bbPress (r3653)

Parameters

$forum_args

array

Redirect to the group forum screen

new_reply_redirect_to($redirect_url = '', $redirect_to = '', $reply_id = 0
since 2.1.0 bbPress (r3653)

Parameters

$redirect_url

$redirect_to

$reply_id

Redirect to the group forum screen

new_topic_redirect_to(\str $redirect_url = '', \str $redirect_to = '', $topic_id = 0
since 2.1.0 bbPress (r3653)

Parameters

$redirect_url

\str

$redirect_to

\str

$topic_id

Strip super stickies from the topic query

no_super_stickies(array $super = array()) : array
since 2.3.0 bbPress (r4810)
access private

Parameters

$super

array

the super sticky post ID's

Returns

array(empty)

Used to end an output buffer

ob_end_clean() 
since 2.1.0 bbPress (r3746)

Used to start an output buffer

ob_start() 
since 2.1.0 bbPress (r3746)

Map a post link to its group forum

post_link(string $url, \obj $post) : string
since 2.2.0 bbPress (r4266)

Parameters

$url

string

$post

\obj

Returns

string

Map a custom post type link to its group forum

post_type_link(string $url, \obj $post) : string
since 2.2.0 bbPress (r4266)

Parameters

$url

string

$post

\obj

Returns

string

Ensure that forum content associated with a BuddyPress group can only be viewed via the group URL.

redirect_canonical() 
since 2.1.0 bbPress (r3802)

Removing a group forum or category (including root for group)

remove_forum(array $forum_args = array()) : void
since 2.1.0 bbPress (r3653)

Parameters

$forum_args

array

Remove the topic meta cap map, so it doesn't interfere with sidebars.

remove_group_forum_meta_cap_map() 
since 2.2.0 bbPress (r4434)

Fix pagination of replies on topic view

replies_pagination(array $args) : array
since 2.2.0 bbPress (r4266)

Parameters

$args

array

Returns

array

Toggle the enable_forum group setting on or off

toggle_group_forum(integer $group_id = 0, boolean $enabled = false) : False
since 2.3.0 bbPress (r4612)

Parameters

$group_id

integer

The group to toggle

$enabled

boolean

True for on, false for off

Returns

Falseif group is not found, otherwise return the group

Fix pagination of topics on forum view

topic_pagination(array $args) : array
since 2.2.0 bbPress (r4266)

Parameters

$args

array

Returns

array

Output a dropdown for picking which group forum this topic is for.

topic_parent() 
since 2.1.0 bbPress (r3746)

Unset the type super sticky from topic type

unset_super_sticky(array $args = array()) : array
since 2.3.0 bbPress (r4810)
access private

Parameters

$args

array

Returns

array$args without the to-front link

Set forums' status to match the privacy status of the associated group

update_group_forum_visibility(\BP_Groups_Group $group) 
Static

Fired whenever a group is saved

Parameters

$group

\BP_Groups_Group

Group object.

Validate the reply to for a reply in a group forum.

validate_reply_to_id(integer $reply_id = 0

This method ensures that when a reply to is saved, it is only allowed to be saved to the current topic.

If all checks fail, an error gets added to prevent the reply from saving.

since 2.6.14

Parameters

$reply_id

integer

Validate the forum ID for a topic in a group forum.

validate_topic_forum_id(integer $topic_id = 0

This method ensures that when a topic is saved, it is only allowed to be saved to a forum that is either:

  • A forum in the current group
  • A forum the current user can moderate outside of this group

If all checks fail, an error gets added to prevent the topic from saving.

since 2.6.14

Parameters

$topic_id

integer

Allow the variables, actions, and filters to be modified by third party plugins and themes.

fully_loaded() 
since 2.6.0 bbPress (r6808)

Setup the group forums class actions

setup_actions() 
since 2.3.0 bbPress (r4552)

Setup the group forums class filters

setup_filters() 
since 2.3.0 bbPress (r4552)

Setup the group forums class variables

setup_variables() 
since 2.1.0 bbPress (r3552)