Functions

Deprecated locale filter

_bbp_filter_locale(string $locale = '', $domain = '') : string
package bbPress
since 2.2.0 bbPress (r4213)

Parameters

$locale

string

$domain

Returns

string$domain

Deprecated forums query filter

_bbp_has_forums_query(array $args = array()) : array
package bbPress
since 2.1.0 bbPress (r3961)

Parameters

$args

array

Returns

array

Deprecated replies query filter

_bbp_has_replies_query(array $args = array()) : array
package bbPress
since 2.1.0 bbPress (r3961)

Parameters

$args

array

Returns

array

Used by bbp_has_replies() to add the lead topic post to the posts loop

_bbp_has_replies_where(string $where = '', $query = false) : string

This function filters the 'post_where' of the WP_Query, and changes the query to include both the topic AND its children in the same loop.

package bbPress
since 2.1.0 bbPress (r4058)

Parameters

$where

string

$query

Returns

string

Deprecated topics query filter

_bbp_has_topics_query(array $args = array()) : array
package bbPress
since 2.1.0 bbPress (r3961)

Parameters

$args

array

Returns

array

Include bbPress via `plugins_loaded` event

_load_bbpress() 

This could maybe me earlier on muplugins_loaded but time will tell what works best for us.

package bbPress

Load the bbPress/PHPUnit test-suite loader

_load_loader() 
package bbPress

Runs on bbPress activation

bbp_activation() 
package bbPress
since 2.0.0 bbPress (r2509)

Adds capabilities to WordPress user roles.

bbp_add_caps() 
package bbPress
since 2.0.0 bbPress (r2608)

Adds an error message to later be output in the theme

bbp_add_error(string $code = '', string $message = '', string $data = ''
package bbPress
since 2.0.0 bbPress (r3381)
see

Parameters

$code

string

Unique code for the error message

$message

string

Translated error message

$data

string

Any additional data passed with the error message

Remove a forum from a group

bbp_add_forum_id_to_group(integer $group_id = 0, $forum_id = 0
package bbPress
since 2.1.0 bbPress (r3653)

Parameters

$group_id

integer

$forum_id

Add the bbPress roles to the $wp_roles global.

bbp_add_forums_roles(\WP_Roles $wp_roles = null) : \WP_Roles

We do this to avoid adding these values to the database.

Note: bbPress is purposely assertive here, overwriting any keys & values that may already exist in the $wp_roles array.

package bbPress
since 2.2.0 bbPress (r4290)

Parameters

$wp_roles

\WP_Roles

The array of WP_Role objects that was initialized

Returns

\WP_RolesThe main $wp_roles global

Add a group to a forum

bbp_add_group_id_to_forum($forum_id = 0, integer $group_id = 0
package bbPress
since 2.1.0 bbPress (r3653)

Parameters

$forum_id

$group_id

integer

Add a moderator to an object

bbp_add_moderator(integer $object_id = 0, integer $user_id = 0, string $object_type = 'post') : boolean
package bbPress
since 2.6.0 bbPress (r6056)

Parameters

$object_id

integer

Traditionally a post ID

$user_id

integer

User ID

$object_type

string

Type of meta (post,term,user,comment)

Returns

boolean

Add default options

bbp_add_options() 

Hooked to bbp_activate, it is only called once when bbPress is activated. This is non-destructive, so existing settings will not be overridden.

package bbPress
since 2.0.0 bbPress (r3421)

Add an upgrade ID to pending upgrades array

bbp_add_pending_upgrade(string $upgrade_id = ''
package bbPress
since 2.6.0 bbPress (r6895)

Parameters

$upgrade_id

string

Add the bbPress-specific permalink structures

bbp_add_permastructs() 
package bbPress
since 2.4.0 bbPress (r4918)

Add the bbPress-specific rewrite rules

bbp_add_rewrite_rules() 
package bbPress
since 2.4.0 bbPress (r4918)

Add the bbPress-specific rewrite tags

bbp_add_rewrite_tags() 
package bbPress
since 2.0.0 bbPress (r2753)

Adds bbPress-specific user roles.

bbp_add_roles() 
package bbPress
since 2.0.0 bbPress (r2741)
deprecated 2.2.0 bbPress (r4164)

Add sticky topics to a topics query object

bbp_add_sticky_topics(\WP_Query $query, array $args = array()
package bbPress
since 2.6.0 bbPress (r6402)

Parameters

$query

\WP_Query

$args

array

Add template locations to template files being searched for

bbp_add_template_stack_locations(array $stacks = array()) : \array()
package bbPress
since 2.1.0 bbPress (r3738)

Parameters

$stacks

array

Returns

\array()

Add a topic to user's engagements

bbp_add_user_engagement(integer $user_id = 0, integer $topic_id = 0) : boolean

Note that both the User and Topic should be verified to exist before using this function. Originally both were validated, but because this function is frequently used within a loop, those verifications were moved upstream to improve performance on topics with many engaged users.

package bbPress
since 2.6.0 bbPress (r6320)

Parameters

$user_id

integer

Optional. User id

$topic_id

integer

Optional. Topic id

Returns

booleanAlways true

Add a topic to user's favorites

bbp_add_user_favorite(integer $user_id = 0, integer $topic_id = 0) : boolean

Note that both the User and Topic should be verified to exist before using this function. Originally both were validated, but because this function is frequently used within a loop, those verifications were moved upstream to improve performance on topics with many engaged users.

package bbPress
since 2.0.0 bbPress (r2652)

Parameters

$user_id

integer

Optional. User id

$topic_id

integer

Optional. Topic id

Returns

booleanTrue if the topic was added to user's favorites, otherwise false

Output the forum-role field when adding a new user

bbp_add_user_form_role_field() 
package bbPress
since 2.6.0 bbPress (r6674)

Add a forum to user's subscriptions

bbp_add_user_forum_subscription(integer $user_id = 0, integer $forum_id = 0) : boolean
package bbPress
since 2.5.0 bbPress (r5156)
deprecated 2.6.0 bbPress (r6543)

Parameters

$user_id

integer

Optional. User id

$forum_id

integer

Optional. forum id

Returns

booleanAlways true

Add default user options

bbp_add_user_options($user_id = 0

This is destructive, so existing bbPress user options will be overridden.

package bbPress
since 2.1.0 bbPress (r3910)

Parameters

$user_id

Add a user subscription

bbp_add_user_subscription(integer $user_id = 0, integer $object_id = 0, string $type = 'post') : boolean
package bbPress
since 2.5.0 bbPress (r5156)
since 2.6.0 bbPress (r6544) Added $type parameter

Parameters

$user_id

integer

Optional. User id

$object_id

integer

Optional. Object id

$type

string

Optional. Type of object being subscribed to

Returns

booleanTrue if the object was added to user subscriptions, otherwise false

Add a user id to an object

bbp_add_user_to_object(integer $object_id = 0, integer $user_id = 0, string $rel_key = '', string $rel_type = 'post', boolean $unique = false) : boolean
package bbPress
since 2.6.0 bbPress (r6109)

Parameters

$object_id

integer

The object id

$user_id

integer

The user id

$rel_key

string

The relationship key

$rel_type

string

The relationship type (usually 'post')

$unique

boolean

Whether meta key should be unique to the object

Returns

booleanReturns true on success, false on failure

Add a topic to user's subscriptions

bbp_add_user_topic_subscription(integer $user_id = 0, integer $topic_id = 0) : boolean

Note that both the User and Topic should be verified to exist before using this function. Originally both were validated, but because this function is frequently used within a loop, those verifications were moved upstream to improve performance on topics with many engaged users.

package bbPress
since 2.0.0 bbPress (r2668)
deprecated 2.6.0 bbPress (r6543)

Parameters

$user_id

integer

Optional. User id

$topic_id

integer

Optional. Topic id

Returns

booleanAlways true

Append 'view=all' to query string if it's already there from referer

bbp_add_view_all(string $original_link = '', boolean $force = false) : string
package bbPress
since 2.0.0 bbPress (r3325)

Parameters

$original_link

string

Original Link to be modified

$force

boolean

Override bbp_get_view_all() check

Returns

stringThe link with 'view=all' appended if necessary

Setup bbPress admin

bbp_admin() 
package bbPress
since 2.0.0 bbPress (r1000)
since 2.6.0 bbPress (r6598) Moved to actions.php

Tell WordPress we have a custom menu order

bbp_admin_custom_menu_order(boolean $menu_order = false) : mixed
package bbPress
since 2.0.0 bbPress (r2957)

Parameters

$menu_order

boolean

Menu order

Returns

mixedTrue if separator, false if not

Setup bbPress Forums Admin

bbp_admin_forums(\WP_Screen $current_screen) 

This is currently here to make hooking and unhooking of the admin UI easy. It could use dependency injection in the future, but for now this is easier.

package bbPress
since 2.0.0 bbPress (r2596)

Parameters

$current_screen

\WP_Screen

Current screen object

Get all of the settings fields.

bbp_admin_get_settings_fields() : array
package bbPress
since 2.1.0 bbPress (r4001)

Returns

array

Get settings fields by section.

bbp_admin_get_settings_fields_for_section(string $section_id = '') : mixed
package bbPress
since 2.1.0 bbPress (r4001)
staticvar array $fields All of the available fields

Parameters

$section_id

string

ID of the section to get fields for

Returns

mixedFalse if section is invalid, array of fields otherwise.

Get the Forums settings sections.

bbp_admin_get_settings_sections() : array
package bbPress
since 2.1.0 bbPress (r4001)

Returns

array

Piggy back admin_head action

bbp_admin_head() 
package bbPress
since 2.1.0 bbPress (r3766)

Piggy back admin_init action

bbp_admin_init() 
package bbPress
since 2.1.0 bbPress (r3766)

Piggy back admin_menu action

bbp_admin_menu() 
package bbPress
since 2.1.0 bbPress (r3766)

Move our custom separator above our custom post types

bbp_admin_menu_order(array $menu_order) : array
package bbPress
since 2.0.0 bbPress (r2957)

Parameters

$menu_order

array

Menu Order

Returns

arrayModified menu order

Piggy back admin_notices action

bbp_admin_notices() 
package bbPress
since 2.1.0 bbPress (r3766)

Repair closed topics

bbp_admin_repair_closed_topics() : array

Closed topics that are missing the post-meta "_bbp_status" key value "publish" result in unexpected behavior, primarily this would have only occurred if you had imported forums from another forum package previous to bbPress v2.6, https://bbpress.trac.wordpress.org/ticket/2577

package bbPress
since 2.6.0 bbPress (r5668)

Returns

arrayAn array of the status code and the message

Recount non-public forum replies

bbp_admin_repair_forum_hidden_reply_count() : array
package bbPress
since 2.6.0 bbPress (r6922)
since 2.6.0 bbPress (r6932) Rename to match the topic reply recount function

Returns

arrayAn array of the status code and the message

Repair the parent forum meta for each topic and reply

bbp_admin_repair_forum_meta() : array
package bbPress
since 2.1.0 bbPress (r3876)

Returns

arrayAn array of the status code and the message

Recount forum replies

bbp_admin_repair_forum_reply_count() : array
package bbPress
since 2.0.0 bbPress (r2613)

Returns

arrayAn array of the status code and the message

Recount forum topics

bbp_admin_repair_forum_topic_count() : array
package bbPress
since 2.0.0 bbPress (r2613)

Returns

arrayAn array of the status code and the message

Repair the private and hidden forums

bbp_admin_repair_forum_visibility() : array
package bbPress
since 2.2.0 bbPress (r4104)

Returns

arrayAn array of the status code and the message

Repair the last post in every topic and forum

bbp_admin_repair_freshness() : array
package bbPress
since 2.0.0 bbPress (r3040)

Returns

arrayAn array of the status code and the message

Handle the processing and feedback of the admin tools page

bbp_admin_repair_handler() 
package bbPress
since 2.0.0 bbPress (r2613)

Get the array of the repairs to show in a list table.

bbp_admin_repair_list($type = 'repair') : array

Uses known filters to reduce the registered results down to the most finite set of tools.

package bbPress
since 2.0.0 bbPress (r2613)

Parameters

$type

Returns

arrayRepair list of options

Output a select drop-down of components to filter by

bbp_admin_repair_list_components_filter() 
package bbPress
since 2.5.0 bbPress (r5885)

Output the repair list search form

bbp_admin_repair_list_search_form() 
package bbPress
since 2.6.0 bbPress (r5885)

Output a select drop-down of versions to filter by

bbp_admin_repair_list_versions_filter() 
package bbPress
since 2.5.0 bbPress (r6894)

Admin repair page

bbp_admin_repair_page() 
package bbPress
since 2.0.0 bbPress (r2613) Converted from bbPress 1.2
since 2.6.0 bbPress (r5885) Upgraded to list-table UI
todo Use a real list table

Recalculate reply menu order

bbp_admin_repair_reply_menu_order() : array
package bbPress
since 2.5.4 bbPress (r5367)

Returns

arrayAn array of the status code and the message

Repair the relationship of sticky topics to the actual parent forum

bbp_admin_repair_sticky() : array
package bbPress
since 2.3.0 bbPress (r4695)

Returns

arrayAn array of the status code and the message

Output filter links for overheads for a specific admin repair tool

bbp_admin_repair_tool_overhead_filters(array $args = array()
package bbPress
since 2.6.0 bbPress (r5885)

Parameters

$args

array

Output the URL to run a specific repair tool

bbp_admin_repair_tool_run_url(string $component = array()
package bbPress
since 2.6.0 bbPress (r5885)

Parameters

$component

string

Output filter links for statuses

bbp_admin_repair_tool_status_filters(array $args = array()
package bbPress
since 2.6.0 bbPress (r6925)

Parameters

$args

array

Maybe translate a repair tool component name

bbp_admin_repair_tool_translate_component(string $component = '') : string
package bbPress
since 2.6.0 bbPress (r5885)

Parameters

$component

string

Returns

string

Maybe translate a repair tool overhead name

bbp_admin_repair_tool_translate_overhead(string $overhead = '') : string
package bbPress
since 2.6.0 bbPress (r6177)

Parameters

$overhead

string

Returns

string

Maybe translate a repair tool overhead name

bbp_admin_repair_tool_translate_version(string $version = '') : string
package bbPress
since 2.6.0 bbPress (r6894)

Parameters

$version

string

Returns

string

Recount non-public replies per topic (pending/spammed/trashed)

bbp_admin_repair_topic_hidden_reply_count() : array
package bbPress
since 2.0.0 bbPress (r2747)

Returns

arrayAn array of the status code and the message

Repair the topic for each post

bbp_admin_repair_topic_meta() : array
package bbPress
since 2.1.0 bbPress (r3876)

Returns

arrayAn array of the status code and the message

Recount topic replies

bbp_admin_repair_topic_reply_count() : array
package bbPress
since 2.0.0 bbPress (r2613)

Returns

arrayAn array of the status code and the message

Recount topic in each topic-tag

bbp_admin_repair_topic_tag_count() : array
package bbPress
since 2.6.0 bbPress (r6256)

Returns

arrayAn array of the status code and the message

Recount topic voices

bbp_admin_repair_topic_voice_count() : array
package bbPress
since 2.0.0 bbPress (r2613)

Returns

arrayAn array of the status code and the message

Repair user favorites

bbp_admin_repair_user_favorites() : array
package bbPress
since 2.0.0 bbPress (r2613)

Returns

arrayAn array of the status code and the message

Clean the user forum subscriptions

bbp_admin_repair_user_forum_subscriptions() : array
package bbPress
since 2.5.0 bbPress (r5155)

Returns

arrayAn array of the status code and the message

Recount topic replied by the users

bbp_admin_repair_user_reply_count() : array
package bbPress
since 2.0.0 bbPress (r2613)

Returns

arrayAn array of the status code and the message

This repair tool will map each user of the current site to their respective forums role. By default, Admins will be Key Masters, and every other role will be the default role defined in Settings > Forums (Participant).

bbp_admin_repair_user_roles() 
package bbPress
since 2.2.0 bbPress (r4340)

Recount topics by the users

bbp_admin_repair_user_topic_count() : array
package bbPress
since 2.1.0 bbPress (r3889)

Returns

arrayAn array of the status code and the message

Clean the user topic subscriptions

bbp_admin_repair_user_topic_subscriptions() : array
package bbPress
since 2.0.0 bbPress (r2668)

Returns

arrayAn array of the status code and the message

Setup bbPress Replies Admin

bbp_admin_replies(\WP_Screen $current_screen) 

This is currently here to make hooking and unhooking of the admin UI easy. It could use dependency injection in the future, but for now this is easier.

package bbPress
since 2.0.0 bbPress (r2596)

Parameters

$current_screen

\WP_Screen

Current screen object

Perform a bbPress database reset.

bbp_admin_reset_database() 
package bbPress
since 2.6.0 bbPress

Handle a bbPress admin area reset request.

bbp_admin_reset_handler() 
package bbPress
since 2.0.0 bbPress (r2613)

Admin reset page

bbp_admin_reset_page() 
package bbPress
since 2.0.0 bbPress (r2613)

Wrapper for determining admin reset query feedback presented to a user.

bbp_admin_reset_query_feedback(array $args = array()) : string
package bbPress
since 2.6.0 bbPress (r6758)

Parameters

$args

array

Array of query, message, and possible responses

Returns

string

Add a separator to the WordPress admin menus

bbp_admin_separator() 
package bbPress
since 2.0.0 bbPress (r2957)

Allow Akismet setting field

bbp_admin_setting_callback_akismet() 
package bbPress
since 2.1.0 bbPress (r3575)

Extension settings section description for the settings page

bbp_admin_setting_callback_akismet_section() 
package bbPress
since 2.1.0 bbPress (r3575)

Allow anonymous posting setting field

bbp_admin_setting_callback_anonymous() 
package bbPress
since 2.0.0 bbPress (r2737)

Extension settings section description for the settings page

bbp_admin_setting_callback_buddypress_section() 
package bbPress
since 2.1.0 bbPress (r3575)

Edit slug setting field

bbp_admin_setting_callback_edit_slug() 
package bbPress
since 2.6.2 bbPress (r6965)

Edit lock setting field

bbp_admin_setting_callback_editlock() 
package bbPress
since 2.0.0 bbPress (r2737)

Allow engagements setting field

bbp_admin_setting_callback_engagements() 
package bbPress
since 2.0.0 bbPress (r2737)

Allow favorites setting field

bbp_admin_setting_callback_favorites() 
package bbPress
since 2.0.0 bbPress (r2786)

Features settings section description for the settings page

bbp_admin_setting_callback_features_section() 
package bbPress
since 2.0.0 bbPress (r2786)

Allow forum-mods setting field

bbp_admin_setting_callback_forum_mods() 
package bbPress
since 2.6.0 bbPress (r5834)

Forum slug setting field

bbp_admin_setting_callback_forum_slug() 
package bbPress
since 2.0.0 bbPress (r2786)

Allow global access setting field

bbp_admin_setting_callback_global_access() 
package bbPress
since 2.0.0 bbPress (r3378)

Allow BuddyPress group forums setting field

bbp_admin_setting_callback_group_forums() 
package bbPress
since 2.1.0 bbPress (r3575)

Replies per page setting field

bbp_admin_setting_callback_group_forums_root_id() 
package bbPress
since 2.1.0 bbPress (r3575)

Include root slug setting field

bbp_admin_setting_callback_include_root() 
package bbPress
since 2.0.0 bbPress (r2786)

Per page settings section description for the settings page

bbp_admin_setting_callback_per_page_section() 
package bbPress
since 2.0.0 bbPress (r2786)

Per page settings section description for the settings page

bbp_admin_setting_callback_per_rss_page_section() 
package bbPress
since 2.0.0 bbPress (r2786)

Replies per page setting field

bbp_admin_setting_callback_replies_per_page() 
package bbPress
since 2.0.0 bbPress (r2786)

Replies per RSS page setting field

bbp_admin_setting_callback_replies_per_rss_page() 
package bbPress
since 2.0.0 bbPress (r2786)

Reply archive slug setting field

bbp_admin_setting_callback_reply_archive_slug() 
package bbPress
since 2.4.0 bbPress (r4932)

Reply slug setting field

bbp_admin_setting_callback_reply_slug() 
package bbPress
since 2.0.0 bbPress (r2786)

Allow topic and reply revisions

bbp_admin_setting_callback_revisions() 
package bbPress
since 2.0.0 bbPress (r3412)

Root slug setting field

bbp_admin_setting_callback_root_slug() 
package bbPress
since 2.0.0 bbPress (r2786)

Slugs settings section description for the settings page

bbp_admin_setting_callback_root_slug_section() 
package bbPress
since 2.0.0 bbPress (r2786)

Search slug setting field

bbp_admin_setting_callback_search_slug() 
package bbPress
since 2.3.0 bbPress (r4579)

Include root slug setting field

bbp_admin_setting_callback_show_on_root() 
package bbPress
since 2.0.0 bbPress (r2786)

Slugs settings section description for the settings page

bbp_admin_setting_callback_single_slug_section() 
package bbPress
since 2.0.0 bbPress (r2786)

Allow subscriptions setting field

bbp_admin_setting_callback_subscriptions() 
package bbPress
since 2.0.0 bbPress (r2737)

Use the WordPress editor setting field

bbp_admin_setting_callback_subtheme_id() 
package bbPress
since 2.1.0 bbPress (r3586)

Main subtheme section

bbp_admin_setting_callback_subtheme_section() 
package bbPress
since 2.0.0 bbPress (r2786)

Allow super-mods setting field

bbp_admin_setting_callback_super_mods() 
package bbPress
since 2.6.0 bbPress (r6562)

Hierarchical reply maximum depth level setting field

bbp_admin_setting_callback_thread_replies_depth() 

Replies will be threaded if depth is 2 or greater

package bbPress
since 2.4.0 bbPress (r4944)

Throttle setting field

bbp_admin_setting_callback_throttle() 
package bbPress
since 2.0.0 bbPress (r2737)

Topic archive slug setting field

bbp_admin_setting_callback_topic_archive_slug() 
package bbPress
since 2.0.0 bbPress (r2786)

Topic slug setting field

bbp_admin_setting_callback_topic_slug() 
package bbPress
since 2.0.0 bbPress (r2786)

Topic tag slug setting field

bbp_admin_setting_callback_topic_tag_slug() 
package bbPress
since 2.0.0 bbPress (r2786)

Allow topic tags setting field

bbp_admin_setting_callback_topic_tags() 
package bbPress
since 2.4.0 bbPress (r4944)

Topics per page setting field

bbp_admin_setting_callback_topics_per_page() 
package bbPress
since 2.0.0 bbPress (r2786)

Topics per RSS page setting field

bbp_admin_setting_callback_topics_per_rss_page() 
package bbPress
since 2.0.0 bbPress (r2786)

Allow oEmbed in replies

bbp_admin_setting_callback_use_autoembed() 
package bbPress
since 2.1.0 bbPress (r3752)

Use the WordPress editor setting field

bbp_admin_setting_callback_use_wp_editor() 
package bbPress
since 2.1.0 bbPress (r3586)

Engagements slug setting field

bbp_admin_setting_callback_user_engagements_slug() 
package bbPress
since 2.6.0 bbPress (r6320)

Favorites slug setting field

bbp_admin_setting_callback_user_favs_slug() 
package bbPress
since 2.4.0 bbPress (r4932)

User settings section description for the settings page

bbp_admin_setting_callback_user_section() 
package bbPress
since 2.0.0 bbPress (r2786)

User slug setting field

bbp_admin_setting_callback_user_slug() 
package bbPress
since 2.0.0 bbPress (r2786)

Slugs settings section description for the settings page

bbp_admin_setting_callback_user_slug_section() 
package bbPress
since 2.0.0 bbPress (r2786)

Subscriptions slug setting field

bbp_admin_setting_callback_user_subs_slug() 
package bbPress
since 2.4.0 bbPress (r4932)

View slug setting field

bbp_admin_setting_callback_view_slug() 
package bbPress
since 2.0.0 bbPress (r2789)

The main settings page

bbp_admin_settings() 
package bbPress
since 2.0.0 bbPress (r2643)

Contextual help for Forums settings page

bbp_admin_settings_help() 
package bbPress
since 2.0.0 bbPress (r3119)

Dedicated action to output admin tools.php sections

bbp_admin_tool_box() 
package bbPress
since 2.6.0 bbPress (r6273)

Output a bbPress specific tools box

bbp_admin_tools_box() 
package bbPress
since 2.6.0 bbPress (r6273)

Contextual help for Import Forums tools page

bbp_admin_tools_converter_help() 
package bbPress
since 2.6.0 bbPress (r5314)

Assemble the admin notices

bbp_admin_tools_feedback(string|\WP_Error $message, string $class = false, boolean $is_dismissible = true) : string
package bbPress
since 2.0.0 bbPress (r2613)

Parameters

$message

string\WP_Error

A message to be displayed or {@link WP_Error}

$class

string

Optional. A class to be added to the message div

$is_dismissible

boolean

Optional. True to dismiss, false to persist

Returns

stringThe message HTML

Contextual help for Repair Forums tools page

bbp_admin_tools_repair_help() 
package bbPress
since 2.6.0 bbPress (r5314)

Contextual help for Reset Forums tools page

bbp_admin_tools_reset_help() 
package bbPress
since 2.6.0 bbPress (r5314)

Setup bbPress Topics Admin

bbp_admin_topics(\WP_Screen $current_screen) 

This is currently here to make hooking and unhooking of the admin UI easy. It could use dependency injection in the future, but for now this is easier.

package bbPress
since 2.0.0 bbPress (r2596)

Parameters

$current_screen

\WP_Screen

Current screen object

Upgrade group forum ID mappings after a bbPress 1.x to bbPress 2.x conversion

bbp_admin_upgrade_group_forum_relationships() : \If

Previously named: bbp_admin_repair_group_forum_relationships()

package bbPress
since 2.6.0 bbPress (r4395)

Returns

\Ifa wp_error() occurs and no converted forums are found

Admin repair page

bbp_admin_upgrade_page() 
package bbPress
since 2.6.0 bbPress (r6278)

Remove favorites data from user meta for bbPress 2.6 and higher

bbp_admin_upgrade_remove_favorites_from_usermeta() : array
package bbPress
since 2.6.0 bbPress (r6281)

Returns

arrayAn array of the status code and the message

Remove topic subscriptions data from user meta for bbPress 2.6 and higher

bbp_admin_upgrade_remove_forum_subscriptions_from_usermeta() : array
package bbPress
since 2.6.0 bbPress (r6281)

Returns

arrayAn array of the status code and the message

Remove topic subscriptions data from user meta for bbPress 2.6 and higher

bbp_admin_upgrade_remove_topic_subscriptions_from_usermeta() : array
package bbPress
since 2.6.0 bbPress (r6281)

Returns

arrayAn array of the status code and the message

Upgrade user engagements for bbPress 2.6 and higher

bbp_admin_upgrade_user_engagements() : array
package bbPress
since 2.6.0 bbPress (r6320)

Returns

arrayAn array of the status code and the message

Upgrade user favorites for bbPress 2.6 and higher

bbp_admin_upgrade_user_favorites() : array
package bbPress
since 2.6.0 bbPress (r6174)

Returns

arrayAn array of the status code and the message

Upgrade user forum subscriptions for bbPress 2.6 and higher

bbp_admin_upgrade_user_forum_subscriptions() : array
package bbPress
since 2.6.0 bbPress (r6193)

Returns

arrayAn array of the status code and the message

Upgrade user topic subscriptions for bbPress 2.6 and higher

bbp_admin_upgrade_user_topic_subscriptions() : array
package bbPress
since 2.6.0 bbPress (r6174)

Returns

arrayAn array of the status code and the message

The main action used for executing code after the theme has been setup

bbp_after_setup_theme() 
package bbPress
since 2.1.0 bbPress (r3732)

Send headers for AJAX specific requests

bbp_ajax_headers() 

This was abstracted from bbp_do_ajax() for use in custom theme-side AJAX implementations.

package bbPress
since 2.6.0 bbPress (r6757)

Helper method to return JSON response for bbPress AJAX calls

bbp_ajax_response(boolean $success = false, string $content = '', $status = -1, array $extras = array()
package bbPress
since 2.3.0 bbPress (r4542)

Parameters

$success

boolean

$content

string

$status

$extras

array

Output the URL to use for theme-side bbPress AJAX requests

bbp_ajax_url() 
package bbPress
since 2.3.0 bbPress (r4543)

Is the anonymous posting allowed?

bbp_allow_anonymous(boolean $default = 0) : boolean
package bbPress
since 2.0.0 bbPress (r2659)

Parameters

$default

boolean

Optional. Default value

Returns

booleanIs anonymous posting allowed?

Is content editing available when posting new topics & replies?

bbp_allow_content_edit(boolean $default = 1) : boolean
package bbPress
since 2.6.0 bbPress (r6441)

Parameters

$default

boolean

Optional. Default value false

Returns

booleanIs content editing allowed?

Is content throttling engaged when posting new topics & replies?

bbp_allow_content_throttle(boolean $default = 1) : boolean
package bbPress
since 2.6.0 bbPress (r6441)

Parameters

$default

boolean

Optional. Default value false

Returns

booleanIs content throttling allowed?

Are per-forum moderators allowed

bbp_allow_forum_mods(boolean $default = 1) : boolean
package bbPress
since 2.6.0 bbPress (r5834)

Parameters

$default

boolean

Optional. Default value true.

Returns

booleanAre per-forum moderators allowed?

Filter an array of forum IDs that are being excluded, and remove any forum IDs a user explicitly has access to.

bbp_allow_forums_of_user(array $forum_ids = array(), integer $user_id = 0) : array

This typically means private or hidden forums the user has moderation rights to, but it can be filtered to mean just about anything.

This function filters the return values of the following functions:

  • bbp_get_private_forum_ids()
  • bbp_get_hidden_forum_ids()
package bbPress
since 2.6.0 bbPress (r6426)

Parameters

$forum_ids

array

Forum IDs to check if the user ID is a moderator of

$user_id

integer

User ID to check if is a moderator of forums

Returns

array

Is this forum available to all users on all sites in this installation?

bbp_allow_global_access(boolean $default = 1) : boolean
package bbPress
since 2.0.0 bbPress (r3378)

Parameters

$default

boolean

Optional. Default value false

Returns

booleanIs global access allowed?

Are topic and reply revisions allowed

bbp_allow_revisions(boolean $default = 1) : boolean
package bbPress
since 2.0.0 bbPress (r3412)

Parameters

$default

boolean

Optional. Default value true

Returns

booleanAre revisions allowed?

Are moderators allowed to edit users

bbp_allow_super_mods(boolean $default = 0) : boolean
package bbPress
since 2.6.0 bbPress (r6562)

Parameters

$default

boolean

Optional. Default value true.

Returns

booleanAre moderators allowed to edit users?

Are threaded replies allowed

bbp_allow_threaded_replies(boolean $default = 0) : boolean
package bbPress
since 2.4.0 bbPress (r4964)

Parameters

$default

boolean

Optional. Default value false

Returns

booleanAre threaded replies allowed?

Are topic tags allowed

bbp_allow_topic_tags(boolean $default = 1) : boolean
package bbPress
since 2.2.0 bbPress (r4097)

Parameters

$default

boolean

Optional. Default value true

Returns

booleanAre tags allowed?

Output all of the allowed tags in HTML format with attributes.

bbp_allowed_tags() 

This is useful for displaying in the post area, which elements and attributes are supported. As well as any plugins which want to display it.

package bbPress
since 2.0.0 bbPress (r2780)

Filter the allowed themes list for bbPress specific themes

bbp_allowed_themes(array $themes) : array
package bbPress
since 2.0.0 bbPress (r2944)

Parameters

$themes

array

Returns

arrayArray of allowed themes

Approves a reply

bbp_approve_reply(integer $reply_id = 0) : mixed
package bbPress
since 2.6.0 bbPress (r5506)

Parameters

$reply_id

integer

Reply id

Returns

mixedFalse or {@link WP_Error} on failure, reply id on success

Approves a pending topic

bbp_approve_topic(integer $topic_id = 0) : mixed
package bbPress
since 2.6.0 bbPress (r5503)

Parameters

$topic_id

integer

Topic id

Returns

mixedFalse or {@link WP_Error} on failure, topic id on success

Update forum reply counts when a topic is approved or unapproved.

bbp_approved_unapproved_topic_update_forum_reply_count(integer $topic_id = 0) : void
package bbPress
since 2.6.0 bbPress (r6036)

Parameters

$topic_id

integer

The topic id.

Output the bbPress asset version

bbp_asset_version() 
package bbPress
since 2.6.7 bbPress (r7188)

Output the author display-name of a topic or reply.

bbp_author_display_name(integer $post_id = 0

Convenience function to ensure proper template functions are called and correct filters are executed. Used primarily to display topic and reply author information in the anonymous form template-part.

package bbPress
since 2.5.0 bbPress (r5119)

Parameters

$post_id

integer

Output the author email of a topic or reply.

bbp_author_email(integer $post_id = 0

Convenience function to ensure proper template functions are called and correct filters are executed. Used primarily to display topic and reply author information in the anonymous user form template-part.

package bbPress
since 2.5.0 bbPress (r5119)

Parameters

$post_id

integer

Output the author IP address of a post

bbp_author_ip(array $args = array()
package bbPress
since 2.0.0 bbPress (r3120)

Parameters

$args

array

Optional. If it is an integer, it is used as post id.

Anonymous user information meta-box

bbp_author_metabox(\WP_Post $post) 
package bbPress
since 2.0.0 bbPress (r2828)

Parameters

$post

\WP_Post

The current post object

Output the author url of a topic or reply.

bbp_author_url(integer $post_id = 0

Convenience function to ensure proper template functions are called and correct filters are executed. Used primarily to display topic and reply author information in the anonymous user form template-part.

package bbPress
since 2.5.0 bbPress (r5119)

Parameters

$post_id

integer

Use the above is_() functions to output a body class for each scenario

bbp_body_class(array $wp_classes = array(), array $custom_classes = false) : array
package bbPress
since 2.0.0 bbPress (r2926)

Parameters

$wp_classes

array

$custom_classes

array

Returns

arrayBody Classes

Setup globals BEFORE includes

bbp_boot_strap_globals() 
package bbPress
since 2.0.0 bbPress (r2599)

Output a breadcrumb

bbp_breadcrumb($args = array()
package bbPress
since 2.0.0 bbPress (r2589)

Parameters

$args

Hooked into the new reply function, this notification action is responsible for notifying topic and hierarchical reply authors of topic replies.

bbp_buddypress_add_notification(integer $reply_id = 0, integer $topic_id = 0, integer $forum_id = 0, array $anonymous_data = array(), integer $author_id = 0, boolean $is_edit = false, integer $reply_to = 0
package bbPress
since 2.5.0 bbPress (r5156)

Parameters

$reply_id

integer

$topic_id

integer

$forum_id

integer

(not used)

$anonymous_data

array

(not used)

$author_id

integer

$is_edit

boolean

Used to bail if this gets hooked to an edit action

$reply_to

integer

Mark notifications as read when reading a topic

bbp_buddypress_mark_notifications($action = '') : \If
package bbPress
since 2.5.0 bbPress (r5155)

Parameters

$action

Returns

\Ifnot trying to mark a notification as read

Get a template part in an output buffer, and return it

bbp_buffer_template_part(string $slug, string $name = null, $echo = true) : string
package bbPress
since 2.4.0 bbPress (r5043)

Parameters

$slug

string

$name

string

$echo

Returns

string

Bump the total topic count of a forum

bbp_bump_forum_reply_count(integer $forum_id = 0, integer $difference = 1, boolean $update_ancestors = true) : integer
package bbPress
since 2.1.0 bbPress (r3825)

Parameters

$forum_id

integer

Optional. Forum id.

$difference

integer

Optional. Default 1

$update_ancestors

boolean

Optional. Default true

Returns

integerForum topic count

Bump the total topic count of a forum

bbp_bump_forum_reply_count_hidden(integer $forum_id = 0, integer $difference = 1, boolean $update_ancestors = true) : integer
package bbPress
since 2.6.0 bbPress (r6922)

Parameters

$forum_id

integer

Optional. Forum id.

$difference

integer

Optional. Default 1

$update_ancestors

boolean

Optional. Default true

Returns

integerForum topic count

Bump the total topic count of a forum

bbp_bump_forum_topic_count(integer $forum_id = 0, integer $difference = 1, boolean $update_ancestors = true) : integer
package bbPress
since 2.1.0 bbPress (r3825)

Parameters

$forum_id

integer

Optional. Forum id.

$difference

integer

Optional. Default 1

$update_ancestors

boolean

Optional. Default true

Returns

integerForum topic count

Bump the total topic count of a forum

bbp_bump_forum_topic_count_hidden(integer $forum_id = 0, integer $difference = 1, boolean $update_ancestors = true) : integer
package bbPress
since 2.1.0 bbPress (r3825)

Parameters

$forum_id

integer

Optional. Forum id.

$difference

integer

Optional. Default 1

$update_ancestors

boolean

Optional. Default true

Returns

integerForum topic count

Bump the total reply count of a topic

bbp_bump_topic_reply_count(integer $topic_id = 0, integer $difference = 1) : integer
package bbPress
since 2.1.0 bbPress (r3825)

Parameters

$topic_id

integer

Optional. Topic id.

$difference

integer

Optional. Default 1

Returns

integerTopic reply count

Bump the total hidden reply count of a topic

bbp_bump_topic_reply_count_hidden(integer $topic_id = 0, integer $difference = 1) : integer
package bbPress
since 2.1.0 bbPress (r3825)

Parameters

$topic_id

integer

Optional. Topic id.

$difference

integer

Optional. Default 1

Returns

integerTopic hidden reply count

Bump the reply count for a user by a certain amount.

bbp_bump_user_reply_count(integer $user_id = 0, integer $difference = 1
package bbPress
since 2.6.0 bbPress (r5309)

Parameters

$user_id

integer

$difference

integer

Bump the topic count for a user by a certain amount.

bbp_bump_user_topic_count(integer $user_id = 0, integer $difference = 1
package bbPress
since 2.6.0 bbPress (r5309)

Parameters

$user_id

integer

$difference

integer

Make the forum a category

bbp_categorize_forum(integer $forum_id = 0) : boolean
package bbPress
since 2.0.0 bbPress (r2746)

Parameters

$forum_id

integer

Optional. Forum id

Returns

booleanFalse on failure, true on success

Deprecated. Use bbp_check_for_moderation() with strict flag set.

bbp_check_for_blacklist($anonymous_data = array(), $author_id = 0, $title = '', $content = ''
package bbPress
since 2.0.0 bbPress (r3446)
since 2.6.0 bbPress (r6854)
deprecated 2.6.0 Use bbp_check_for_moderation() with strict flag set

Parameters

$anonymous_data

$author_id

$title

$content

Check for duplicate topics/replies

bbp_check_for_duplicate(array $post_data = array()) : boolean

Check to make sure that a user is not making a duplicate post

package bbPress
since 2.0.0 bbPress (r2763)

Parameters

$post_data

array

Contains information about the comment

Returns

booleanTrue if it is not a duplicate, false if it is

Check for flooding

bbp_check_for_flood(array $anonymous_data = array(), integer $author_id = 0) : boolean

Check to make sure that a user is not making too many posts in a short amount of time.

package bbPress
since 2.0.0 bbPress (r2734)

Parameters

$anonymous_data

array

Optional - if it's an anonymous post. Do not supply if supplying $author_id. Should be sanitized (see {@link bbp_filter_anonymous_post_data()}

$author_id

integer

Optional. Supply if it's a post by a logged in user. Do not supply if supplying $anonymous_data.

Returns

booleanTrue if there is no flooding, false if there is

Checks topics and replies against the discussion moderation of blocked keys

bbp_check_for_moderation(array $anonymous_data = array(), integer $author_id = 0, string $title = '', string $content = '', mixed $strict = false) : boolean
package bbPress
since 2.1.0 bbPress (r3581)

Parameters

$anonymous_data

array

Optional - if it's an anonymous post. Do not supply if supplying $author_id. Should be sanitized (see {@link bbp_filter_anonymous_post_data()}

$author_id

integer

Topic or reply author ID

$title

string

The title of the content

$content

string

The content being posted

$strict

mixed

False for moderation_keys. True for blacklist_keys. String for custom keys.

Returns

booleanTrue if test is passed, false if fail

Redirect if unauthorized user is attempting to edit a forum

bbp_check_forum_edit() 
package bbPress
since 2.1.0 bbPress (r3607)

Check to see if the post is currently being edited by another user.

bbp_check_post_lock(integer $post_id = 0) : integer
package bbPress
see
since 2.6.0 bbPress (r6340)

Parameters

$post_id

integer

ID of the post to check for editing

Returns

integerFalse: not locked or locked by current user. Int: user ID of user with lock.

Redirect if unauthorized user is attempting to edit a reply

bbp_check_reply_edit() 
package bbPress
since 2.1.0 bbPress (r3605)

Redirect if unauthorized user is attempting to edit a topic

bbp_check_topic_edit() 
package bbPress
since 2.1.0 bbPress (r3605)

Redirect if unauthorized user is attempting to edit a topic tag

bbp_check_topic_tag_edit() 
package bbPress
since 2.1.0 bbPress (r3605)

Redirect if unauthorized user is attempting to edit another user

bbp_check_user_edit() 

This is hooked to 'bbp_template_redirect' and controls the conditions under which a user can edit another user (or themselves.) If these conditions are met, we assume a user cannot perform this task, and look for ways they can earn the ability to access this template.

package bbPress
since 2.1.0 bbPress (r3605)

Automatically splits bbPress emails with many Bcc recipients into chunks.

bbp_chunk_emails(array $args = array()) : array

This middleware is useful because topics and forums with many subscribers run into problems with Bcc limits, and many hosting companies & third-party services limit the size of a Bcc audience to prevent spamming.

The default "chunk" size is 40 users per iteration, and can be filtered if desired. A future version of bbPress will introduce a setting to more easily tune this.

package bbPress
since 2.6.0 bbPress (r6918)

Parameters

$args

array

Original arguments passed to wp_mail().

Returns

array

Will clean a post in the cache.

bbp_clean_post_cache(integer $post_id = null, \WP_Post $post = null

Will call to clean the term object cache associated with the post ID.

package bbPress
since 2.1.0 bbPress (r4040)
since 2.6.0 bbPress (r6053) Introduced the `$post_id` parameter.

Parameters

$post_id

integer

The post id.

$post

\WP_Post

The WP_Post object.

Delete all pending upgrades

bbp_clear_pending_upgrades() 
package bbPress
since 2.6.0 bbPress (r6895)

Closes a forum

bbp_close_forum(integer $forum_id = 0) : mixed
package bbPress
since 2.0.0 bbPress (r2746)

Parameters

$forum_id

integer

forum id

Returns

mixedFalse or {@link WP_Error} on failure, forum id on success

Closes a topic

bbp_close_topic(integer $topic_id = 0) : mixed
package bbPress
since 2.0.0 bbPress (r2740)

Parameters

$topic_id

integer

Topic id

Returns

mixedFalse or {@link WP_Error} on failure, topic id on success

Filter the topic or reply content and output code and pre tags

bbp_code_trick(string $content = '') : string
package bbPress
since 2.3.0 bbPress (r4641)

Parameters

$content

string

Topic and reply content

Returns

stringPartially encoded content

When editing a topic or reply, reverse the code trick so the textarea contains the correct editable content.

bbp_code_trick_reverse(string $content = '') : string
package bbPress
since 2.3.0 bbPress (r4641)

Parameters

$content

string

Topic and reply content

Returns

stringPartially encoded content

Setup constants

bbp_constants() 
package bbPress
since 2.0.0 bbPress (r2599)

Convert time supplied from database query into specified date format.

bbp_convert_date(string $time, string $d = 'U', boolean $translate = false) : string
package bbPress
since 2.0.0 bbPress (r2544)

Parameters

$time

string

Time to convert

$d

string

Optional. Default is 'U'. Either 'G', 'U', or php date format

$translate

boolean

Optional. Default is false. Whether to translate the

Returns

stringReturns timestamp

Edit Clean setting field

bbp_converter_setting_callback_clean() 
package bbPress
since 2.1.0 bbPress (r3813)

Edit Convert Users setting field

bbp_converter_setting_callback_convert_users() 
package bbPress
since 2.1.0 bbPress (r3813)

Edit Database Name setting field

bbp_converter_setting_callback_dbname() 
package bbPress
since 2.1.0 bbPress (r3813)

Edit Database Pass setting field

bbp_converter_setting_callback_dbpass() 
package bbPress
since 2.1.0 bbPress (r3813)

Edit Database Server Port setting field

bbp_converter_setting_callback_dbport() 
package bbPress
since 2.1.0 bbPress (r3813)

Edit Table Prefix setting field

bbp_converter_setting_callback_dbprefix() 
package bbPress
since 2.1.0 bbPress (r3813)

Edit Database Server setting field

bbp_converter_setting_callback_dbserver() 
package bbPress
since 2.1.0 bbPress (r3813)

Edit Database User setting field

bbp_converter_setting_callback_dbuser() 
package bbPress
since 2.1.0 bbPress (r3813)

Edit Delay Time setting field

bbp_converter_setting_callback_delay_time() 
package bbPress
since 2.1.0 bbPress (r3813)

Edit Halt setting field

bbp_converter_setting_callback_halt() 
package bbPress
since 2.6.0 bbPress (r6599)

Main settings section description for the settings page

bbp_converter_setting_callback_main_section() 
package bbPress
since 2.1.0 bbPress (r3813)

Main settings section description for the settings page

bbp_converter_setting_callback_options_section() 
package bbPress
since 2.1.0 bbPress (r3813)

Edit Platform setting field

bbp_converter_setting_callback_platform() 
package bbPress
since 2.1.0 bbPress (r3813)

Edit Restart setting field

bbp_converter_setting_callback_restart() 
package bbPress
since 2.1.0 bbPress (r3813)

Edit Rows Limit setting field

bbp_converter_setting_callback_rows() 
package bbPress
since 2.1.0 bbPress (r3813)

The main settings page

bbp_converter_settings_page() 
package bbPress
since 2.1.0 bbPress (r3186)

Create a default forum, topic, and reply

bbp_create_initial_content(array $args = array()
package bbPress
since 2.1.0 bbPress (r3767)

Parameters

$args

array

Array of arguments to override default values

Echoes the values for current poster (uses WP comment cookies)

bbp_current_anonymous_user_data(string $key = ''
package bbPress
since 2.0.0 bbPress (r2734)

Parameters

$key

string

Which value to echo?

Get the poster IP address

bbp_current_author_ip() : string
package bbPress
since 2.0.0 bbPress (r3120)
since 2.6.0 bbPress (r5609) Added `empty()` check for unit tests

Returns

string

Get the poster user agent

bbp_current_author_ua() : string
package bbPress
since 2.0.0 bbPress (r3446)

Returns

string

Dedicated action to hook into the current screen

bbp_current_screen(\WP_Screen $current_screen = ''
package bbPress
since 2.6.0 bbPress (r6185)

Parameters

$current_screen

\WP_Screen

Output avatar of current user

bbp_current_user_avatar(integer $size = 40
package bbPress
since 2.0.0 bbPress (r2574)

Parameters

$size

integer

Size of the avatar. Defaults to 40

Performs a series of checks to ensure the current user should see the anonymous user form fields.

bbp_current_user_can_access_anonymous_user_form() : boolean
package bbPress
since 2.5.0 bbPress (r5119)

Returns

boolean

Performs a series of checks to ensure the current user can create forums.

bbp_current_user_can_access_create_forum_form() : boolean
package bbPress
since 2.1.0 bbPress (r3549)

Returns

boolean

Performs a series of checks to ensure the current user can create replies.

bbp_current_user_can_access_create_reply_form() : boolean
package bbPress
since 2.0.0 bbPress (r3127)

Returns

boolean

Performs a series of checks to ensure the current user can create topics.

bbp_current_user_can_access_create_topic_form() : boolean
package bbPress
since 2.0.0 bbPress (r3127)

Returns

boolean

Check if the current user can publish forums

bbp_current_user_can_publish_forums() : boolean
package bbPress
since 2.1.0 bbPress (r3549)

Returns

boolean

Check if the current user can publish replies

bbp_current_user_can_publish_replies() : boolean
package bbPress
since 2.0.0 bbPress (r3127)

Returns

boolean

Check if the current user can publish topics

bbp_current_user_can_publish_topics() : boolean
package bbPress
since 2.0.0 bbPress (r3127)

Returns

boolean

Output ID of current user

bbp_current_user_id() 
package bbPress
since 2.0.0 bbPress (r2574)

Output name of current user

bbp_current_user_name() 
package bbPress
since 2.0.0 bbPress (r2574)

bbPress Dashboard Right Now Widget

bbp_dashboard_widget_right_now() 

Adds a dashboard widget with forum statistics

package bbPress
since 2.0.0 bbPress (r2770)
deprecated 2.6.0 bbPress (r5268)

Return the database class being used to interface with the environment.

bbp_db() : object

This function is abstracted to avoid global touches to the primary database class. bbPress supports WordPress's $wpdb global by default, and can be filtered to support other configurations if needed.

package bbPress
since 2.5.8 bbPress (r5814)

Returns

object

Output the bbPress database version

bbp_db_version() 
package bbPress
since 2.0.0 bbPress (r3468)

Output the bbPress database version directly from the database

bbp_db_version_raw() 
package bbPress
since 2.0.0 bbPress (r3468)

Runs on bbPress deactivation

bbp_deactivation() 
package bbPress
since 2.0.0 bbPress (r2509)

Callback to decode the tags in topic or reply content

bbp_decode_callback(array $matches = array()) : string
package bbPress
since 2.3.0 bbPress (r4641)
todo Experiment with _wp_specialchars()

Parameters

$matches

array

Returns

string

Decrease the total reply count of a forum by one.

bbp_decrease_forum_reply_count(integer $forum_id = 0) : void
package bbPress
since 2.6.0 bbPress (r6036)

Parameters

$forum_id

integer

The forum id.

Decrease the total hidden reply count of a forum by one.

bbp_decrease_forum_reply_count_hidden(integer $forum_id = 0) : void
package bbPress
since 2.6.0 bbPress (r6036)

Parameters

$forum_id

integer

The forum id.

Decrease the total topic count of a forum by one.

bbp_decrease_forum_topic_count(integer $forum_id = 0) : void
package bbPress
since 2.6.0 bbPress (r6036)

Parameters

$forum_id

integer

The forum id.

Decrease the total hidden topic count of a forum by one.

bbp_decrease_forum_topic_count_hidden(integer $forum_id = 0) : void
package bbPress
since 2.6.0 bbPress (r6036)

Parameters

$forum_id

integer

The forum id.

Decrease the total reply count of a topic by one.

bbp_decrease_topic_reply_count(integer $topic_id = 0) : void
package bbPress
since 2.6.0 bbPress (r6036)

Parameters

$topic_id

integer

The topic id.

Decrease the total hidden reply count of a topic by one.

bbp_decrease_topic_reply_count_hidden(integer $topic_id = 0) : void
package bbPress
since 2.6.0 bbPress (r6036)

Parameters

$topic_id

integer

The topic id.

Helper function used to increase (by one) the count of replies for a user when a topic is unpublished.

bbp_decrease_user_reply_count($reply_id = 0
package bbPress
since 2.6.0 bbPress (r5309)

Parameters

$reply_id

Helper function used to decrease (by one) the count of topics for a user when a topic is unpublished.

bbp_decrease_user_topic_count($topic_id = 0
package bbPress
since 2.6.0 bbPress (r5309)

Parameters

$topic_id

Generate a default intercept value.

bbp_default_intercept() : string
package bbPress
since 2.6.0
staticvar mixed $rand Null by default, random string on first call

Returns

string

Called before deleting a forum.

bbp_delete_forum($forum_id = 0

This function is supplemental to the actual forum deletion which is handled by WordPress core API functions. It is used to clean up after a forum that is being deleted.

package bbPress
since 2.1.0 bbPress (r3668)

Parameters

$forum_id

Delete all topics (and their replies) for a specific forum ID

bbp_delete_forum_topics(integer $forum_id = 0) : \If
package bbPress
since 2.1.0 bbPress (r3668)

Parameters

$forum_id

integer

Returns

\Ifforum is not valid

Delete default options

bbp_delete_options() 

Hooked to bbp_uninstall, it is only called once when bbPress is uninstalled. This is destructive, so existing settings will be destroyed.

package bbPress
since 2.0.0 bbPress (r3421)

Called before deleting a reply

bbp_delete_reply($reply_id = 0
package bbPress

Parameters

$reply_id

Delete a blogs rewrite rules, so that they are automatically rebuilt on the subsequent page load.

bbp_delete_rewrite_rules() 
package bbPress
since 2.2.0 bbPress (r4198)

Called before deleting a topic.

bbp_delete_topic($topic_id = 0

This function is supplemental to the actual topic deletion which is handled by WordPress core API functions. It is used to clean up after a topic that is being deleted.

package bbPress

Parameters

$topic_id

Delete replies to a topic when it's deleted

bbp_delete_topic_replies(integer $topic_id = 0

Usually you'll want to do this before the topic itself is deleted.

package bbPress
since 2.6.0 bbPress (r5405)

Parameters

$topic_id

integer

Delete default user options

bbp_delete_user_options($user_id = 0

Hooked to bbp_uninstall, it is only called once when bbPress is uninstalled. This is destructive, so existing bbPress user options will be destroyed.

package bbPress
since 2.1.0 bbPress (r3910)

Parameters

$user_id

Called after deleting a forum

bbp_deleted_forum($forum_id = 0

Try not to use this action. All meta & taxonomy terms have already been deleted, making them impossible to use.

package bbPress
since 2.1.0 bbPress (r3668)
since 2.6.0 bbPress (r6526) Not recommend for usage

Parameters

$forum_id

Called after deleting a reply

bbp_deleted_reply($reply_id = 0
package bbPress
since 2.0.0 bbPress (r2993)

Parameters

$reply_id

Called after deleting a topic

bbp_deleted_topic($topic_id = 0
package bbPress
since 2.0.0 bbPress (r2993)

Parameters

$topic_id

Deregisters a previously registered template stack location.

bbp_deregister_template_stack(string $location_callback = '', integer $priority = 10) : boolean
package bbPress
since 2.3.0 bbPress (r4652)

Parameters

$location_callback

string

Callback function that returns the

$priority

integer

Returns

booleanWhether stack was removed

Deregister a bbPress view

bbp_deregister_view(string $view) : boolean
package bbPress
since 2.0.0 bbPress (r2789)

Parameters

$view

string

View name

Returns

booleanFalse if the view doesn't exist, true on success

Output an RSS2 feed of replies, based on the query passed.

bbp_display_replies_feed_rss2(array $replies_query = array()
package bbPress
since 2.0.0 bbPress (r3171)

Parameters

$replies_query

array

Output an RSS2 feed of topics, based on the query passed.

bbp_display_topics_feed_rss2(array $topics_query = array()
package bbPress
since 2.0.0 bbPress (r3171)

Parameters

$topics_query

array

Output a sanitized user field value

bbp_displayed_user_field(string $field = '', string $filter = 'display'

This function relies on the $filter parameter to decide how to sanitize the field value that it finds. Since it uses the WP_User object's magic __get() method, it can also be used to get user_meta values.

package bbPress
since 2.0.0 bbPress (r2688)

Parameters

$field

string

Field to get

$filter

string

How to filter the field value (null|raw|db|display|edit)

Output ID of displayed user

bbp_displayed_user_id() 
package bbPress
since 2.0.0 bbPress (r2688)

Hooked to the 'bbp_template_redirect' action, this is also the custom theme-side AJAX handler.

bbp_do_ajax(string $action = '') : \If

This is largely taken from admin-ajax.php, but adapted specifically for theme-side bbPress-only AJAX requests.

package bbPress
since 2.3.0 bbPress (r4543)

Parameters

$action

string

Sanitized action from bbp_post_request/bbp_get_request

Returns

\Ifnot a bbPress AJAX request

Uninstall all bbPress options and capabilities from a specific site.

bbp_do_uninstall(integer $site_id = 0
package bbPress
since 2.1.0 bbPress (r3765)

Parameters

$site_id

integer

Return if auto-saving or not

bbp_doing_autosave() : boolean
package bbPress
since 2.6.7 (r7188)

Returns

booleanTrue if mid auto-save. False if not mid auto-save.

Return if debugging scripts or not

bbp_doing_script_debug() : boolean
package bbPress
since 2.6.7 (r7188)

Returns

booleanTrue if debugging scripts. False if not debugging scripts.

Output a select box allowing to pick which forum/topic a new topic/reply belongs in.

bbp_dropdown(array $args = array()

Can be used for any post type, but is mostly used for topics and forums.

package bbPress
since 2.0.0 bbPress (r2746)

Parameters

$args

array

See {@link bbp_get_dropdown()} for arguments

Dummy gettext calls to get strings in the catalog.

bbp_dummy_role_names() 
package bbPress
since 2.6.0 bbPress

Handles the front end edit forum submission

bbp_edit_forum_handler(string $action = ''
package bbPress

Parameters

$action

string

The requested action to compare this function to

Output the number of minutes a topic or reply can be edited after it's published. Used by `bbp_past_edit_lock()`.

bbp_edit_lock(boolean $default = 5
package bbPress
since 2.6.0 bbPress (r6868)

Parameters

$default

boolean

Optional. Default value 5

Handles the front end edit reply submission

bbp_edit_reply_handler(string $action = ''
package bbPress

Parameters

$action

string

The requested action to compare this function to id, anonymous data, reply author, bool true (for edit), and the reply to id

Handles the front end edit topic submission

bbp_edit_topic_handler(string $action = ''
package bbPress

Parameters

$action

string

The requested action to compare this function to

Handles the front end tag management (renaming, merging, destroying)

bbp_edit_topic_tag_handler(string $action = ''
package bbPress
since 2.0.0 bbPress (r2768)

Parameters

$action

string

The requested action to compare this function to

Output blog role selector (for user edit)

bbp_edit_user_blog_role() 
package bbPress
since 2.0.0 bbPress (r2688)

Return user contact methods select box

bbp_edit_user_contact_methods() : string
package bbPress
since 2.0.0 bbPress (r2688)

Returns

stringUser contact methods

Drop down for selecting the user's display name

bbp_edit_user_display_name() 
package bbPress
since 2.0.0 bbPress (r2688)

Sends an email when an email address change occurs on POST requests

bbp_edit_user_email_send_notification($user_id = 0, $args = array()
package bbPress
since 2.6.0 bbPress (r5660)
see

Parameters

$user_id

$args

Output the required hidden fields when editing a user

bbp_edit_user_form_fields() 
package bbPress
since 2.0.0 bbPress (r2690)

Output forum role selector (for user edit)

bbp_edit_user_forums_role() 
package bbPress
since 2.2.0 bbPress (r4284)

Handles the front end user editing from POST requests

bbp_edit_user_handler(string $action = ''
package bbPress
since 2.0.0 bbPress (r2790)

Parameters

$action

string

The requested action to compare this function to

Output the language chooser (for user edit)

bbp_edit_user_language(array $args = array()) : string
package bbPress
since 2.6.0 bbPress (r6488)

Parameters

$args

array

See wp_dropdown_languages()

Returns

string

Filter the content and encode any bad HTML tags

bbp_encode_bad(string $content = '') : string
package bbPress
since 2.3.0 bbPress (r4641)

Parameters

$content

string

Topic and reply content

Returns

stringPartially encoded content

Callback to encode the tags in topic or reply content

bbp_encode_callback(array $matches = array()) : string
package bbPress
since 2.3.0 bbPress (r4641)

Parameters

$matches

array

Returns

string

How to interact with engagements

bbp_engagements_strategy(boolean $default = 'meta') : string

There are 3 possible strategies:

  • 'meta' 2.6 and higher. Uses multiple postmeta keys.
  • 'user' Pre-2.6. Uses comma-separated string of IDs in usermeta.
  • 'term' Alternate. Uses taxonomy term relationships.
package bbPress
since 2.6.0 bbPress (r6875)

Parameters

$default

boolean

Optional. Default value false

Returns

stringHow to interact with engagements

Enqueue a script from the highest priority location in the template stack.

bbp_enqueue_script(string $handle = '', string|boolean $file = '', array $deps = array(), string|boolean $ver = false, boolean $in_footer = false) : mixed

Registers the style if file provided (does NOT overwrite) and enqueues.

package bbPress
since 2.5.0 bbPress (r5180)

Parameters

$handle

string

Name of the script.

$file

stringboolean

Relative path to the script. Example: '/js/myscript.js'.

$deps

array

An array of registered handles this script depends on. Default empty array.

$ver

stringboolean

Optional. String specifying the script version number, if it has one. This parameter is used to ensure that the correct version is sent to the client regardless of caching, and so should be included if a version number is available and makes sense for the script.

$in_footer

boolean

Optional. Whether to enqueue the script before or before . Default 'false'. Accepts 'false' or 'true'.

Returns

mixedThe script filename if one is located. False if not.

Enqueue bbPress specific CSS and JS

bbp_enqueue_scripts() 
package bbPress
since 2.0.0 bbPress (r3373)

Enqueue a script from the highest priority location in the template stack.

bbp_enqueue_style(string $handle = '', string|boolean $file = '', array $deps = array(), string|boolean $ver = false, string $media = 'all') : mixed

Registers the style if file provided (does NOT overwrite) and enqueues.

package bbPress
since 2.5.0 bbPress (r5180)

Parameters

$handle

string

Name of the stylesheet.

$file

stringboolean

Relative path to stylesheet. Example: '/css/mystyle.css'.

$deps

array

An array of registered style handles this stylesheet depends on. Default empty array.

$ver

stringboolean

String specifying the stylesheet version number, if it has one. This parameter is used to ensure that the correct version is sent to the client regardless of caching, and so should be included if a version number is available and makes sense for the stylesheet.

$media

string

Optional. The media for which this stylesheet has been defined. Default 'all'. Accepts 'all', 'aural', 'braille', 'handheld', 'projection', 'print', 'screen', 'tty', or 'tv'.

Returns

mixedThe style filename if one is located. False if not.

Returns a meta_query that either includes or excludes hidden forum IDs from a query.

bbp_exclude_forum_ids(string $type = 'string'
package bbPress
since 2.0.0 bbPress (r3291)

Parameters

$type

string

Optional. The type of value to return. (string|array|meta_query)

Handles the front end adding and removing of favorite topics

bbp_favorites_handler(string $action = ''
package bbPress

Parameters

$action

string

The requested action to compare this function to

Filter anonymous post data

bbp_filter_anonymous_post_data(array $args = array()) : boolean | array

We use REMOTE_ADDR here directly. If you are behind a proxy, you should ensure that it is properly set, such as in wp-config.php, for your environment. See https://core.trac.wordpress.org/ticket/9235

Note that bbp_pre_anonymous_filters() is responsible for sanitizing each of the filtered core anonymous values here.

If there are any errors, those are directly added to \bbPress:errors

package bbPress
since 2.0.0 bbPress (r2734)

Parameters

$args

array

Optional. If no args are there, then $_POST values are

Returns

booleanarrayFalse on errors, values in an array on success

Removes the bbPress roles from the editable roles array

bbp_filter_blog_editable_roles(array $all_roles = array()) : array

This used to use array_diff_assoc() but it randomly broke before 2.2 release. Need to research what happened, and if there's a way to speed this up.

package bbPress
since 2.2.0 bbPress (r4303)

Parameters

$all_roles

array

All registered roles

Returns

array

Filter a list of child counts, from `bbp_get_child_counts()`

bbp_filter_child_counts_list(integer $parent_id = 0, array $types = array('post'), array $statuses = array()) : array
package bbPress
since 2.6.0 bbPress (r6826)

Parameters

$parent_id

integer

ID of post to get child counts from

$types

array

Optional. An array of post types to filter by

$statuses

array

Optional. An array of post statuses to filter by

Returns

arrayA list of objects or object fields.

Show icons in list-table column headers instead of strings

bbp_filter_column_headers(array $columns = array()) : array
package bbPress
since 2.6.0 bbPress (r5833)

Parameters

$columns

array

Column headers fed into list-table objects

Returns

arrayPossibly altered column headers

Filter the Dashboard "at a glance" items and append bbPress elements to it.

bbp_filter_dashboard_glance_items(array $elements = array()) : array
package bbPress
since 2.6.0 bbPress (r5268)

Parameters

$elements

array

Returns

array

Filter default_options set them from inside the $bbp->options array.

bbp_filter_default_option($default = false, $option = '', $passed_default = false) : mixed

This function should not be called directly.

package bbPress
since 2.6.0 bbPress (r3451)
access private

Parameters

$default

$option

$passed_default

Returns

mixedfalse if not overloaded, mixed if set

Filter default options and allow them to be overloaded from inside the $bbp->user_options array.

bbp_filter_get_user_option(boolean $value = false, $option = '', $user = 0) : mixed
package bbPress
since 2.1.0 bbPress (r3910)

Parameters

$value

boolean

Optional. Default value false

$option

$user

Returns

mixedfalse if not overloaded, mixed if set

Filter the bbPress is_single_user function with BuddyPress equivalent

bbp_filter_is_single_user(boolean $is = false) : boolean
package bbPress
since 2.1.0 bbPress (r3552)

Parameters

$is

boolean

Optional. Default false

Returns

booleanTrue if viewing single user, false if not

Filter the bbPress is_user_home function with BuddyPress equivalent

bbp_filter_is_user_home(boolean $is = false) : boolean
package bbPress
since 2.1.0 bbPress (r3552)

Parameters

$is

boolean

Optional. Default false

Returns

booleanTrue if viewing single user, false if not

Custom kses filter for forum topics and replies, for filtering incoming data

bbp_filter_kses(string $data = '') : string
package bbPress
since 2.3.0 bbPress (r4603)

Parameters

$data

string

Content to filter, expected to be escaped with slashes

Returns

stringFiltered content

Add the topic title to the <title> if viewing a single group forum topic

bbp_filter_modify_page_title(string $new_title = '', string $old_title = '', string $sep = '') : string
package bbPress
since 2.5.0 bbPress (r5161)

Parameters

$new_title

string

The title to filter

$old_title

string

(Not used)

$sep

string

The separator to use

Returns

stringThe possibly modified title

Filter registered notifications components, and add 'forums' to the queried 'component_name' array.

bbp_filter_notifications_get_registered_components(array $component_names = array()) : array
package bbPress
since 2.6.0 bbPress (r5232)
see

Parameters

$component_names

array

Returns

array

Filter pre options and maybe overloaded from the $bbp->options array.

bbp_filter_pre_get_option(boolean $value = false, string $option = '') : mixed

This function should not be called directly.

package bbPress
since 2.0.0 bbPress (r3451)
access private

Parameters

$value

boolean

Default value false

$option

string

Name of the option

Returns

mixedfalse if not overloaded, mixed if set

Filter the current bbPress user ID with the current BuddyPress user ID

bbp_filter_user_id(integer $user_id = 0, boolean $displayed_user_fallback = true, boolean $current_user_fallback = false) : integer
package bbPress
since 2.1.0 bbPress (r3552)

Parameters

$user_id

integer

$displayed_user_fallback

boolean

$current_user_fallback

boolean

Returns

integerUser ID

Helper function to add filter to option_wp_user_roles

bbp_filter_user_roles_option() 
package bbPress
since 2.2.0 bbPress (r4363)
deprecated 2.6.0 bbPress (r6105)
see

Searches through the content to locate usernames, designated by an @ sign.

bbp_find_mentions(string $content = '') : boolean | array
package bbPress
since 2.2.0 bbPress (r4323)
deprecated 2.6.0 bbp_make_clickable()

Parameters

$content

string

The content

Returns

booleanarray$usernames Existing usernames. False if no matches.

Set the pattern used for matching usernames for mentions.

bbp_find_mentions_pattern() : string

Moved into its own function to allow filtering of the regex pattern anywhere mentions might be used.

package bbPress
since 2.4.0 bbPress (r4997)
deprecated 2.6.0 bbp_make_clickable()

Returns

stringPattern to match usernames with

Use the previous status when restoring a topic or reply.

bbp_fix_untrash_post_status(string $new_status = 'draft', integer $post_id = 0, string $previous_status = 'pending'

Fixes an issue since WordPress 5.6.0. See https://bbpress.trac.wordpress.org/ticket/3433.

package bbPress
since 2.6.10 bbPress (r7233)

Parameters

$new_status

string

New status to use when untrashing. Default: 'draft'

$post_id

integer

Post ID

$previous_status

string

Previous post status from '_wp_trash_meta_status' meta key. Default: 'pending'

Force comments_status to 'closed' for bbPress post types

bbp_force_comment_status(boolean $open = false, integer $post_id = 0) : boolean
package bbPress
since 2.1.0 bbPress (r3589)

Parameters

$open

boolean

True if open, false if closed

$post_id

integer

ID of the post to check

Returns

booleanTrue if open, false if closed

Output the value of forum content field

bbp_form_forum_content() 
package bbPress
since 2.1.0 bbPress (r3551)

Output value of forum moderators field

bbp_form_forum_moderators() 
package bbPress
since 2.6.0 bbPress (r5837)

Output value of forum parent

bbp_form_forum_parent() 
package bbPress
since 2.1.0 bbPress (r3551)

Output value forum status dropdown

bbp_form_forum_status_dropdown($args = array()
package bbPress
since 2.1.0 bbPress (r3563)

Parameters

$args

This function supports these arguments:

  • select_id: Select id. Defaults to bbp_forum_status
  • tab: Deprecated. Tabindex
  • forum_id: Forum id
  • selected: Override the selected option

Output checked value of forum subscription

bbp_form_forum_subscribed() 
package bbPress
since 2.5.0 bbPress (r5156)

Output the value of forum title field

bbp_form_forum_title() 
package bbPress
since 2.1.0 bbPress (r3551)

Output value of forum type

bbp_form_forum_type() 
package bbPress
since 2.1.0 bbPress (r3563)

Output value forum type dropdown

bbp_form_forum_type_dropdown($args = array()
package bbPress
since 2.1.0 bbPress (r3563)

Parameters

$args

This function supports these arguments:

  • select_id: Select id. Defaults to bbp_forum_type
  • tab: Deprecated. Tabindex
  • forum_id: Forum id
  • selected: Override the selected option

Output value of forum visibility

bbp_form_forum_visibility() 
package bbPress
since 2.1.0 bbPress (r3563)

Output value forum visibility dropdown

bbp_form_forum_visibility_dropdown($args = array()
package bbPress
since 2.1.0 bbPress (r3563)

Parameters

$args

This function supports these arguments:

  • select_id: Select id. Defaults to bbp_forum_visibility
  • tab: Deprecated. Tabindex
  • forum_id: Forum id
  • selected: Override the selected option

Output settings API option

bbp_form_option(string $option, string $default = '', boolean $slug = false
package bbPress
since 2.0.0 bbPress (r3203)

Parameters

$option

string

$default

string

$slug

boolean

Output the value of reply content field

bbp_form_reply_content() 
package bbPress
since 2.0.0 bbPress (r3130)

Output the value of the reply edit reason

bbp_form_reply_edit_reason() 
package bbPress
since 2.0.0 bbPress (r3130)

Output checked value of reply log edit field

bbp_form_reply_log_edit() 
package bbPress
since 2.0.0 bbPress (r3130)

Output value reply status dropdown

bbp_form_reply_status_dropdown($args = array()
package bbPress
since 2.6.0 bbPress (r5399)

Parameters

$args

This function supports these arguments:

  • select_id: Select id. Defaults to bbp_reply_status
  • tab: Deprecated. Tabindex
  • reply_id: Reply id
  • selected: Override the selected option

Output the value of the reply to field

bbp_form_reply_to() 
package bbPress
since 2.4.0 bbPress (r4944)

Used to check if a bbPress slug conflicts with an existing known slug.

bbp_form_slug_conflict_check(string $slug, string $default) 
package bbPress
since 2.0.0 bbPress (r3306)

Parameters

$slug

string

$default

string

Output the value of topic content field

bbp_form_topic_content() 
package bbPress
since 2.0.0 bbPress (r2976)

Output the value of the topic edit reason

bbp_form_topic_edit_reason() 
package bbPress
since 2.0.0 bbPress (r2976)

Output value of topic forum

bbp_form_topic_forum() 
package bbPress
since 2.0.0 bbPress (r2976)

Output checked value of topic log edit field

bbp_form_topic_log_edit() 
package bbPress
since 2.0.0 bbPress (r2976)

Output value topic status dropdown

bbp_form_topic_status_dropdown($args = array()
package bbPress
since 2.4.0 bbPress (r5059)

Parameters

$args

This function supports these arguments:

  • select_id: Select id. Defaults to bbp_topic_status
  • tab: Deprecated. Tabindex
  • topic_id: Topic id
  • selected: Override the selected option

Output checked value of topic subscription

bbp_form_topic_subscribed() 
package bbPress
since 2.0.0 bbPress (r2976)

Output value of topic tags field

bbp_form_topic_tags() 
package bbPress
since 2.0.0 bbPress (r2976)

Output the value of topic title field

bbp_form_topic_title() 
package bbPress
since 2.0.0 bbPress (r2976)

Displays topic type select box (normal/sticky/super sticky)

bbp_form_topic_type_dropdown($args = array()
package bbPress
since 2.4.0 bbPress (r5059)

Parameters

$args

This function supports these arguments:

  • select_id: Select id. Defaults to bbp_stick_topic
  • tab: Deprecated. Tabindex
  • topic_id: Topic id
  • selected: Override the selected option

Generic function to format the dynamic BuddyPress activity action for new topics/replies.

bbp_format_activity_action_new_post(string $type = '', string $action = '', \BP_Activity_Activity $activity = false) : string
package bbPress
since 2.6.0 bbPress (r6370)

Parameters

$type

string

The type of post. Expects topic or reply.

$action

string

The current action string.

$activity

\BP_Activity_Activity

The BuddyPress activity object.

Returns

stringThe formatted activity action.

Formats the dynamic BuddyPress activity action for new replies.

bbp_format_activity_action_new_reply(string $action, object $activity) : string
package bbPress
since 2.6.0 bbPress (r6370)

Parameters

$action

string

The current action string

$activity

object

The BuddyPress activity object

Returns

stringThe formatted activity action

Formats the dynamic BuddyPress activity action for new topics.

bbp_format_activity_action_new_topic(string $action, object $activity) : string
package bbPress
since 2.6.0 bbPress (r6370)

Parameters

$action

string

The current action string

$activity

object

The BuddyPress activity object

Returns

stringThe formatted activity action.

Format the BuddyBar/Toolbar notifications

bbp_format_buddypress_notifications(string $content, integer $item_id, integer $secondary_item_id, integer $action_item_count, string $format, string $component_action_name, string $component_name, integer $id) 
package bbPress
package bbPress
since 2.5.0 bbPress (r5155)

Parameters

$content

string

Component action. Deprecated. Do not do checks against this! Use the 6th parameter instead - $component_action_name.

$item_id

integer

Notification item ID.

$secondary_item_id

integer

Notification secondary item ID.

$action_item_count

integer

Number of notifications with the same action.

$format

string

Format of return. Either 'string' or 'object'.

$component_action_name

string

Canonical notification action.

$component_name

string

Notification component ID.

$id

integer

Notification ID.

Formats the reason for editing the topic/reply.

bbp_format_revision_reason(string $reason = '') : string

Does these things:

  • Trimming
  • Removing periods from the end of the string
  • Trimming again
package bbPress
since 2.0.0 bbPress (r2782)

Parameters

$reason

string

Optional. User submitted reason for editing.

Returns

stringStatus of topic

Output the forum archive title

bbp_forum_archive_title(string $title = ''
package bbPress
since 2.0.0 bbPress (r3249)

Parameters

$title

string

Default text to use as title

Output the author of the forum

bbp_forum_author_display_name(integer $forum_id = 0
package bbPress
since 2.1.0 bbPress (r3675)

Parameters

$forum_id

integer

Optional. Forum id

Output the author ID of the forum

bbp_forum_author_id(integer $forum_id = 0
package bbPress
since 2.1.0 bbPress (r3675)

Parameters

$forum_id

integer

Optional. Forum id

Output the row class of a forum

bbp_forum_class(integer $forum_id = 0, array $classes = array()
package bbPress
since 2.0.0 bbPress (r2667)

Parameters

$forum_id

integer

Optional. Forum ID.

$classes

array

Extra classes you can pass when calling this function

Output the content of the forum

bbp_forum_content(integer $forum_id = 0
package bbPress
since 2.0.0 bbPress (r2780)

Parameters

$forum_id

integer

Optional. Topic id

Check if a user is blocked, or cannot spectate the forums.

bbp_forum_enforce_blocked() 
package bbPress
since 2.0.0 bbPress (r2996)

Check if it's a hidden forum or a topic or reply of a hidden forum and if the user can't view it, then sets a 404

bbp_forum_enforce_hidden() 
package bbPress
since 2.0.0 bbPress (r2996)

Check if it's a private forum or a topic or reply of a private forum and if the user can't view it, then sets a 404

bbp_forum_enforce_private() 
package bbPress
since 2.0.0 bbPress (r2996)

Output the required hidden fields when creating/editing a forum

bbp_forum_form_fields() 
package bbPress
since 2.1.0 bbPress (r3553)

Return subforums of given forum

bbp_forum_get_subforums(array $args = array()) : mixed
package bbPress
since 2.0.0 bbPress (r2747)

Parameters

$args

array

All the arguments supported by {@link WP_Query}

Returns

mixedfalse if none, array of subs if yes

Output forum id

bbp_forum_id($forum_id = 0
package bbPress
since 2.0.0 bbPress (r2464)

Parameters

$forum_id

Optional. Used to check emptiness

Output the forums last active ID

bbp_forum_last_active_id(integer $forum_id = 0
package bbPress
since 2.0.0 bbPress (r2860)

Parameters

$forum_id

integer

Optional. Forum id

Output the forums last update date/time (aka freshness)

bbp_forum_last_active_time(integer $forum_id = 0
package bbPress
since 2.0.0 bbPress (r2464)

Parameters

$forum_id

integer

Optional. Forum id

Output author ID of last reply of forum

bbp_forum_last_reply_author_id(integer $forum_id = 0
package bbPress
since 2.0.0 bbPress (r2625)

Parameters

$forum_id

integer

Optional. Forum id

Output the forums last reply id

bbp_forum_last_reply_id(integer $forum_id = 0
package bbPress
since 2.0.0 bbPress (r2464)

Parameters

$forum_id

integer

Optional. Forum id

Output the title of the last reply inside a forum

bbp_forum_last_reply_title(integer $forum_id = 0
package bbPress

Parameters

$forum_id

integer

Optional. Forum id

Output the url to the last reply in a forum

bbp_forum_last_reply_url(integer $forum_id = 0
package bbPress
since 2.0.0 bbPress (r2683)

Parameters

$forum_id

integer

Optional. Forum id

Output the forum's last topic id

bbp_forum_last_topic_id(integer $forum_id = 0
package bbPress
since 2.0.0 bbPress (r2464)

Parameters

$forum_id

integer

Optional. Forum id

Output the title of the last topic inside a forum

bbp_forum_last_topic_title(integer $forum_id = 0
package bbPress
since 2.0.0 bbPress (r2625)

Parameters

$forum_id

integer

Optional. Forum id

Forum meta-box

bbp_forum_metabox($post) 

The meta-box that holds all of the additional forum information

package bbPress
since 2.0.0 bbPress (r2744)

Parameters

$post

Output the pagination count

bbp_forum_pagination_count() 

The results are unescaped by design, to allow them to be filtered freely via the 'bbp_get_forum_pagination_count' filter.

package bbPress
since 2.0.0 bbPress (r2519)

Output parent ID of a forum, if exists

bbp_forum_parent_id(integer $forum_id = 0
package bbPress
since 2.1.0 bbPress (r3675)

Parameters

$forum_id

integer

Forum ID

Output total post count of a forum

bbp_forum_post_count(integer $forum_id = 0, boolean $total_count = true, boolean $integer = false
package bbPress
since 2.0.0 bbPress (r2954)

Parameters

$forum_id

integer

Optional. Forum id

$total_count

boolean

Optional. To get the total count or normal count?

$integer

boolean

Optional. Whether or not to format the result

Output the unique id of the custom post type for forums

bbp_forum_post_type() 
package bbPress
since 2.0.0 bbPress (r2857)

Returns the forum's last reply id

bbp_forum_query_last_reply_id(integer $forum_id = 0, integer $topic_ids = 0
package bbPress
since 2.0.0 bbPress (r2908)
since 2.6.0 bbPress (r5954) Replace direct queries with WP_Query() objects

Parameters

$forum_id

integer

Forum id.

$topic_ids

integer

Optional. Topic ids.

Returns the forum's subforum ids

bbp_forum_query_subforum_ids(integer $forum_id) 

Only forums with published status are returned

package bbPress
since 2.0.0 bbPress (r2908)

Parameters

$forum_id

integer

Forum id

Returns the forum's topic ids

bbp_forum_query_topic_ids(integer $forum_id) 

Only topics with published and closed statuses are returned

package bbPress
since 2.0.0 bbPress (r2908)

Parameters

$forum_id

integer

Forum id

Output total reply count of a forum

bbp_forum_reply_count(integer $forum_id = 0, boolean $total_count = true, boolean $integer = false
package bbPress
since 2.0.0 bbPress (r2464)

Parameters

$forum_id

integer

Optional. Forum id

$total_count

boolean

Optional. To get the total count or normal count?

$integer

boolean

Optional. Whether or not to format the result

Output total hidden reply count of a forum (hidden includes trashed, spammed, and pending replies)

bbp_forum_reply_count_hidden(integer $forum_id = 0, boolean $total_count = true, boolean $integer = false
package bbPress
since 2.6.0 bbPress (r6922)

Parameters

$forum_id

integer

Optional. Forum id

$total_count

boolean

Optional. To get the total count or normal count?

$integer

boolean

Optional. Whether or not to format the result

Allow forum rows to have administrative actions

bbp_forum_row_actions() 
package bbPress
since 2.1.0 bbPress (r3653)
todo Links and filter

Output the status of the forum

bbp_forum_status(integer $forum_id = 0
package bbPress
since 2.0.0 bbPress (r2667)

Parameters

$forum_id

integer

Optional. Forum id

Output total sub-forum count of a forum

bbp_forum_subforum_count(integer $forum_id = 0, boolean $integer = false
package bbPress
since 2.0.0 bbPress (r2464)

Parameters

$forum_id

integer

Optional. Forum id to check

$integer

boolean

Optional. Whether or not to format the result

Handles the front end toggling of forum subscriptions

bbp_forum_subscriptions_handler($action = ''
package bbPress
since 2.5.0 bbPress (r5156)
deprecated 2.6.0 bbPress (r6543)

Parameters

$action

See who is subscribed to a forum

bbp_forum_subscriptions_metabox($post) 
package bbPress
since 2.6.0 bbPress (r6197)
since 2.6.0 bbPress (r6333) Updated to use BBP_User_Query

Parameters

$post

Output the title of the forum

bbp_forum_title(integer $forum_id = 0
package bbPress
since 2.0.0 bbPress (r2464)

Parameters

$forum_id

integer

Optional. Forum id

Output total topic count of a forum

bbp_forum_topic_count(integer $forum_id = 0, boolean $total_count = true, boolean $integer = false
package bbPress
since 2.0.0 bbPress (r2464)

Parameters

$forum_id

integer

Optional. Forum id

$total_count

boolean

Optional. To get the total count or normal count?

$integer

boolean

Optional. Whether or not to format the result

Output total hidden topic count of a forum (hidden includes trashed, spammed, and pending topics)

bbp_forum_topic_count_hidden(integer $forum_id = 0, boolean $total_count = true, boolean $integer = null
package bbPress
since 2.0.0 bbPress (r2883)
since 2.6.0 bbPress (r6922) Changed function signature to add total counts

Parameters

$forum_id

integer

Optional. Forum id

$total_count

boolean

Optional. To get the total count or normal count?

$integer

boolean

Optional. Whether or not to format the result

Output the type of the forum

bbp_forum_type(integer $forum_id = 0
package bbPress
since 2.1.0 bbPress (r3563)

Parameters

$forum_id

integer

Optional. Forum id

Output the visibility of the forum

bbp_forum_visibility(integer $forum_id = 0
package bbPress
since 2.0.0 bbPress (r2997)

Parameters

$forum_id

integer

Optional. Forum id

Whether there are more forums available in the loop

bbp_forums() : object
package bbPress
since 2.0.0 bbPress (r2464)

Returns

objectForum information

Output the forum URL

bbp_forums_url(string $path = '/'
package bbPress
since 2.1.0 bbPress (r3979)

Parameters

$path

string

Additional path with leading slash

Generate bbPress-specific rewrite rules

bbp_generate_rewrite_rules(\WP_Rewrite $wp_rewrite) 
package bbPress
since 2.0.0 bbPress (r2688)
deprecated 2.4.0 bbPress (r4918)

Parameters

$wp_rewrite

\WP_Rewrite

Return an array of allowed activity actions

bbp_get_activity_actions() : array
package bbPress
since 2.6.0 bbPress (r6370)

Returns

array

Get filter links for components for a specific admin repair tool

bbp_get_admin_repair_tool_components(array $item = array()) : array
package bbPress
since 2.6.0 bbPress (r5885)

Parameters

$item

array

Returns

array

Get filter links for overhead for a specific admin repair tool

bbp_get_admin_repair_tool_overhead(array $item = array()) : array
package bbPress
since 2.6.0 bbPress (r5885)

Parameters

$item

array

Returns

array

Get filter links for overheads for a specific admin repair tool

bbp_get_admin_repair_tool_overhead_filters(array $args = array()) : array
package bbPress
since 2.6.0 bbPress (r5885)

Parameters

$args

array

Returns

array

Return the current admin repair tool page

bbp_get_admin_repair_tool_page() : string
package bbPress
since 2.6.0 bbPress (r6894)

Returns

string

Return the current admin repair tool page ID

bbp_get_admin_repair_tool_page_id() : string
package bbPress
since 2.6.0 bbPress (r6894)

Returns

string

Return a URL to the repair tool page

bbp_get_admin_repair_tool_page_url(array $args = array()) : string
package bbPress
since 2.6.0 bbPress (r6894)

Parameters

$args

array

Returns

string

Return array of components from the array of registered tools

bbp_get_admin_repair_tool_registered_components() : array
package bbPress
since 2.5.0 bbPress (r5885)

Returns

array

Return array of versions from the array of registered tools

bbp_get_admin_repair_tool_registered_versions() : array
package bbPress
since 2.6.0 bbPress (r6894)

Returns

array

Return the URL to run a specific repair tool

bbp_get_admin_repair_tool_run_url(string $component = array()
package bbPress
since 2.6.0 bbPress (r5885)

Parameters

$component

string

Get filter links for statuses

bbp_get_admin_repair_tool_status_filters(array $args = array()) : array
package bbPress
since 2.6.0 bbPress (r5885)

Parameters

$args

array

Returns

array

Get filter links for versions for a specific admin repair tool

bbp_get_admin_repair_tool_version(array $item = array()) : array
package bbPress
since 2.6.0 bbPress (r6894)

Parameters

$item

array

Returns

array

Get the array of available repair tools

bbp_get_admin_repair_tools(string $type = '') : array
package bbPress
since 2.6.0 bbPress (r5885)

Parameters

$type

string

repair|upgrade The type of tools to get. Default empty for all tools.

Returns

array

Return the URL to use for theme-side bbPress AJAX requests

bbp_get_ajax_url() : string
package bbPress
since 2.3.0 bbPress (r4543)
global WP $wp

Returns

string

Query the DB and get the child id's of all children

bbp_get_all_child_ids(integer $parent_id = 0, string $post_type = 'post') : array
package bbPress
since 2.0.0 bbPress (r3325)

Parameters

$parent_id

integer

Parent id

$post_type

string

Post type. Defaults to 'post'

Returns

arrayThe array of children

Display all of the allowed tags in HTML format with attributes.

bbp_get_allowed_tags() : string

This is useful for displaying in the post area, which elements and attributes are supported. As well as any plugins which want to display it.

package bbPress
since 2.0.0 bbPress (r2780)

Returns

stringHTML allowed tags entity encoded.

Return the bbPress asset version

bbp_get_asset_version() 
package bbPress
since 2.6.7 bbPress (r7188)
retrun string The bbPress asset version

Return the author display-name of a topic or reply.

bbp_get_author_display_name(integer $post_id = 0) : string

Convenience function to ensure proper template functions are called and correct filters are executed. Used primarily to display topic and reply author information in the anonymous form template-part.

package bbPress
since 2.5.0 bbPress (r5119)

Parameters

$post_id

integer

Returns

stringThe name of the author

Return the author email of a topic or reply.

bbp_get_author_email(integer $post_id = 0) : string

Convenience function to ensure proper template functions are called and correct filters are executed. Used primarily to display topic and reply author information in the anonymous user form template-part.

package bbPress
since 2.5.0 bbPress (r5119)

Parameters

$post_id

integer

Returns

stringThe email of the author

Return the author IP address of a post

bbp_get_author_ip(array $args = array()) : string
package bbPress
since 2.0.0 bbPress (r3120)

Parameters

$args

array

Optional. If an integer, it is used as reply id.

Returns

stringAuthor link of reply

Return the author url of a topic or reply.

bbp_get_author_url(integer $post_id = 0) : string

Convenience function to ensure proper template functions are called and correct filters are executed. Used primarily to display topic and reply author information in the anonymous user form template-part.

package bbPress
since 2.5.0 bbPress (r5119)

Parameters

$post_id

integer

Returns

stringThe url of the author

The blocked role is for registered users that cannot spectate or participate

bbp_get_blocked_role() : string
package bbPress
since 2.2.0 bbPress (r4284)

Returns

string

Get the available roles, minus the dynamic roles that come with bbPress

bbp_get_blog_roles() : array
package bbPress
since 2.4.0 bbPress (r5064)

Returns

array

Return a breadcrumb ( forum -> topic -> reply )

bbp_get_breadcrumb($args = array()) : string
package bbPress
since 2.0.0 bbPress (r2589)

Parameters

$args

Returns

stringBreadcrumbs

Returns an array of capabilities based on the role that is being requested.

bbp_get_caps_for_role(string $role = '') : array
package bbPress
since 2.0.0 bbPress (r2994)
todo Map all of these and deprecate

Parameters

$role

string

Optional. Defaults to The role to load caps for

Returns

arrayCapabilities for $role

Query the database for child counts, grouped by type & status

bbp_get_child_counts(integer $parent_id = 0
package bbPress
since 2.6.0 bbPress (r6826)

Parameters

$parent_id

integer

Return the closed post status ID

bbp_get_closed_status_id() : string
package bbPress
since 2.0.0 bbPress (r3504)

Returns

string

Return component name/ID ('forums' by default)

bbp_get_component_name() : string

This is used primarily for Notifications integration.

package bbPress
since 2.6.0 bbPress (r5232)

Returns

string

Checks if there is a previous BuddyPress Forum configuration

bbp_get_config_location(string $default = '') : string
package bbPress
since 2.1.0 bbPress (r3790)

Parameters

$default

string

Optional. Default empty string

Returns

stringThe location of the bb-config.php file, if any

Return an array of available converters

bbp_get_converters() : array
package bbPress
since 2.6.0 bbPress (r6447)

Returns

array

Get the cookies for current poster (uses WP comment cookies).

bbp_get_current_anonymous_user_data(string $key = '') : string | array
package bbPress
since 2.0.0 bbPress (r2734)

Parameters

$key

string

Optional. Which value to get? If not given, then an array is returned.

Returns

stringarrayCookie(s) for current poster

Get the current template pack package.

bbp_get_current_template_pack() : \BBP_Theme_Compat
package bbPress
since 2.6.0 bbPress (r6548)

Returns

\BBP_Theme_Compat

Return avatar of current user

bbp_get_current_user_avatar(integer $size = 40) : string
package bbPress
since 2.0.0 bbPress (r2574)

Parameters

$size

integer

Size of the avatar. Defaults to 40

Returns

stringCurrent user avatar

Return ID of current user

bbp_get_current_user_id() : integer
package bbPress
since 2.0.0 bbPress (r2574)

Returns

integerCurrent user id

Return name of current user

bbp_get_current_user_name() : string
package bbPress
since 2.0.0 bbPress (r2574)

Returns

string

Return the bbPress database version

bbp_get_db_version() 
package bbPress
since 2.0.0 bbPress (r3468)
retrun string The bbPress version

Return the bbPress database version directly from the database

bbp_get_db_version_raw() 
package bbPress
since 2.0.0 bbPress (r3468)
retrun string The current bbPress version

Get the default site options and their values.

bbp_get_default_options() : array

These option

package bbPress
since 2.0.0 bbPress (r3421)

Returns

arrayFiltered option names and values

Get the default forums role (issued to users on their first visit to the forums) by bbp_set_current_user_default_role() and repair tools

bbp_get_default_role(string $default = 'bbp_participant') : string
package bbPress
since 2.2.0 bbPress (r4294)

Parameters

$default

string

Optional. Default value empty

Returns

stringThe default forums user role

Get the default user options and their values

bbp_get_default_user_options() : array
package bbPress
since 2.1.0 bbPress (r3910)

Returns

arrayFiltered user option names and values

Return a sanitized user field value

bbp_get_displayed_user_field(string $field = '', string $filter = 'display') : string | boolean

This function relies on the $filter parameter to decide how to sanitize the field value that it finds. Since it uses the WP_User object's magic __get() method, it can also be used to get user_meta values.

package bbPress
since 2.0.0 bbPress (r2688)
see for more on how the value is retrieved
see for more on how the value is sanitized

Parameters

$field

string

Field to get

$filter

string

How to filter the field value (null|raw|db|display|edit)

Returns

stringbooleanValue of the field if it exists, else false

Return ID of displayed user

bbp_get_displayed_user_id() : integer
package bbPress
since 2.0.0 bbPress (r2688)

Returns

integerDisplayed user id

Get the "Do Not Reply" email address to use when sending subscription emails.

bbp_get_do_not_reply_address() : string

We make some educated guesses here based on the home URL. Filters are available to customize this address further. In the future, we may consider using admin_email instead, though this is not normally publicized.

We use $_SERVER['SERVER_NAME'] here to mimic similar functionality in WordPress core. Previously, we used get_home_url() to use already validated user input, but it was causing issues in some installations.

package bbPress
since 2.6.0 bbPress (r5409)
see
see
link https://bbpress.trac.wordpress.org/ticket/2618

Returns

string

Return a select box allowing to pick which forum/topic a new topic/reply belongs in.

bbp_get_dropdown(array $args = array()) : string
package bbPress
since 2.0.0 bbPress (r2746)

Parameters

$args

array

The function supports these args:

  • post_type: Post type, defaults to bbp_get_forum_post_type() (bbp_forum)
  • selected: Selected ID, to not have any value as selected, pass anything smaller than 0 (due to the nature of select box, the first value would of course be selected - though you can have that as none (pass 'show_none' arg))
  • orderby: Defaults to 'menu_order title'
  • post_parent: Post parent. Defaults to 0
  • post_status: Which all post_statuses to find in? Can be an array or CSV of publish, category, closed, private, spam, trash (based on post type) - if not set, these are automatically determined based on the post_type
  • posts_per_page: Retrieve all forums/topics. Defaults to -1 to get all posts
  • walker: Which walker to use? Defaults to {@link BBP_Walker_Dropdown}
  • select_id: ID of the select box. Defaults to 'bbp_forum_id'
  • tab: Deprecated. Tabindex value. False or integer
  • options_only: Show only ? No