[ Index ]

PHP Cross Reference of BBPress

title

Body

[close]

/src/includes/forums/ -> functions.php (summary)

bbPress Forum Functions

File Size: 2784 lines (82 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 61 functions

  bbp_insert_forum()
  bbp_new_forum_handler()
  bbp_edit_forum_handler()
  bbp_save_forum_extras()
  bbp_close_forum()
  bbp_open_forum()
  bbp_categorize_forum()
  bbp_normalize_forum()
  bbp_publicize_forum()
  bbp_privatize_forum()
  bbp_hide_forum()
  bbp_repair_forum_visibility()
  bbp_remove_forum_from_all_subscriptions()
  bbp_bump_forum_topic_count()
  bbp_increase_forum_topic_count()
  bbp_decrease_forum_topic_count()
  bbp_bump_forum_topic_count_hidden()
  bbp_increase_forum_topic_count_hidden()
  bbp_decrease_forum_topic_count_hidden()
  bbp_bump_forum_reply_count()
  bbp_bump_forum_reply_count_hidden()
  bbp_increase_forum_reply_count()
  bbp_decrease_forum_reply_count()
  bbp_increase_forum_reply_count_hidden()
  bbp_decrease_forum_reply_count_hidden()
  bbp_approved_unapproved_topic_update_forum_reply_count()
  bbp_update_forum_last_topic_id()
  bbp_update_forum_last_reply_id()
  bbp_update_forum_last_active_id()
  bbp_update_forum_last_active_time()
  bbp_update_forum_subforum_count()
  bbp_update_forum_topic_count()
  bbp_update_forum_topic_count_hidden()
  bbp_update_forum_reply_count()
  bbp_update_forum_reply_count_hidden()
  bbp_update_forum()
  bbp_get_forum_statuses()
  bbp_get_forum_types()
  bbp_get_forum_visibilities()
  bbp_get_public_forum_statuses()
  bbp_get_non_public_forum_statuses()
  bbp_get_hidden_forum_ids()
  bbp_get_private_forum_ids()
  bbp_get_excluded_forum_ids()
  bbp_exclude_forum_ids()
  bbp_pre_get_posts_normalize_forum_visibility()
  bbp_forum_query_topic_ids()
  bbp_forum_query_subforum_ids()
  bbp_forum_query_last_reply_id()
  bbp_forum_enforce_hidden()
  bbp_forum_enforce_private()
  bbp_check_forum_edit()
  bbp_delete_forum_topics()
  bbp_trash_forum_topics()
  bbp_untrash_forum_topics()
  bbp_delete_forum()
  bbp_trash_forum()
  bbp_untrash_forum()
  bbp_deleted_forum()
  bbp_trashed_forum()
  bbp_untrashed_forum()

Functions
Functions that are not part of a class:

bbp_insert_forum( $forum_data = array()   X-Ref
A wrapper for wp_insert_post() that also includes the necessary meta values
for the forum to function properly.

param: array $forum_data Forum post data
param: arrap $forum_meta Forum meta data
since: 2.0.0 bbPress (r3349)

bbp_new_forum_handler( $action = '' )   X-Ref
Handles the front end forum submission

param: string $action The requested action to compare this function to

bbp_edit_forum_handler( $action = '' )   X-Ref
Handles the front end edit forum submission

param: string $action The requested action to compare this function to

bbp_save_forum_extras( $forum_id = 0 )   X-Ref
Handle the saving of core forum metadata (Status, Visibility, and Type)

return: If forum ID is empty
param: int $forum_id
since: 2.1.0 bbPress (r3678)

bbp_close_forum( $forum_id = 0 )   X-Ref
Closes a forum

return: mixed False or {@link WP_Error} on failure, forum id on success
param: int $forum_id forum id
since: 2.0.0 bbPress (r2746)

bbp_open_forum( $forum_id = 0 )   X-Ref
Opens a forum

return: mixed False or {@link WP_Error} on failure, forum id on success
param: int $forum_id forum id
since: 2.0.0 bbPress (r2746)

bbp_categorize_forum( $forum_id = 0 )   X-Ref
Make the forum a category

return: bool False on failure, true on success
param: int $forum_id Optional. Forum id
since: 2.0.0 bbPress (r2746)

bbp_normalize_forum( $forum_id = 0 )   X-Ref
Remove the category status from a forum

return: bool False on failure, true on success
param: int $forum_id Optional. Forum id
since: 2.0.0 bbPress (r2746)

bbp_publicize_forum( $forum_id = 0, $current_visibility = '' )   X-Ref
Mark the forum as public

return: bool False on failure, true on success
param: int $forum_id Optional. Forum id
since: 2.0.0 bbPress (r2746)

bbp_privatize_forum( $forum_id = 0, $current_visibility = '' )   X-Ref
Mark the forum as private

return: bool False on failure, true on success
param: int $forum_id Optional. Forum id
since: 2.0.0 bbPress (r2746)

bbp_hide_forum( $forum_id = 0, $current_visibility = '' )   X-Ref
Mark the forum as hidden

return: bool False on failure, true on success
param: int $forum_id Optional. Forum id
since: 2.0.0 bbPress (r2996)

bbp_repair_forum_visibility()   X-Ref
Recaches the private and hidden forums

return: array An array of the status code and the message
since: 2.4.0 bbPress (r5017)

bbp_remove_forum_from_all_subscriptions( $forum_id = 0 )   X-Ref
Remove a deleted forum from all user subscriptions

param: int $forum_id Get the forum ID to remove
since: 2.5.0 bbPress (r5156)

bbp_bump_forum_topic_count( $forum_id = 0, $difference = 1, $update_ancestors = true )   X-Ref
Bump the total topic count of a forum

return: int Forum topic count
param: int $forum_id Optional. Forum id.
param: int $difference Optional. Default 1
param: bool $update_ancestors Optional. Default true
since: 2.1.0 bbPress (r3825)

bbp_increase_forum_topic_count( $forum_id = 0 )   X-Ref
Increase the total topic count of a forum by one.

return: void
param: int $forum_id The forum id.
since: 2.6.0 bbPress (r6036)

bbp_decrease_forum_topic_count( $forum_id = 0 )   X-Ref
Decrease the total topic count of a forum by one.

return: void
param: int $forum_id The forum id.
since: 2.6.0 bbPress (r6036)

bbp_bump_forum_topic_count_hidden( $forum_id = 0, $difference = 1, $update_ancestors = true )   X-Ref
Bump the total topic count of a forum

return: int Forum topic count
param: int $forum_id Optional. Forum id.
param: int $difference Optional. Default 1
param: bool $update_ancestors Optional. Default true
since: 2.1.0 bbPress (r3825)

bbp_increase_forum_topic_count_hidden( $forum_id = 0 )   X-Ref
Increase the total hidden topic count of a forum by one.

return: void
param: int $forum_id The forum id.
since: 2.6.0 bbPress (r6036)

bbp_decrease_forum_topic_count_hidden( $forum_id = 0 )   X-Ref
Decrease the total hidden topic count of a forum by one.

return: void
param: int $forum_id The forum id.
since: 2.6.0 bbPress (r6036)

bbp_bump_forum_reply_count( $forum_id = 0, $difference = 1, $update_ancestors = true )   X-Ref
Bump the total topic count of a forum

return: int Forum topic count
param: int $forum_id Optional. Forum id.
param: int $difference Optional. Default 1
param: bool $update_ancestors Optional. Default true
since: 2.1.0 bbPress (r3825)

bbp_bump_forum_reply_count_hidden( $forum_id = 0, $difference = 1, $update_ancestors = true )   X-Ref
Bump the total topic count of a forum

return: int Forum topic count
param: int $forum_id Optional. Forum id.
param: int $difference Optional. Default 1
param: bool $update_ancestors Optional. Default true
since: 2.6.0 bbPress (r6922)

bbp_increase_forum_reply_count( $forum_id = 0 )   X-Ref
Increase the total reply count of a forum by one.

return: void
param: int $forum_id The forum id.
since: 2.6.0 bbPress (r6036)

bbp_decrease_forum_reply_count( $forum_id = 0 )   X-Ref
Decrease the total reply count of a forum by one.

return: void
param: int $forum_id The forum id.
since: 2.6.0 bbPress (r6036)

bbp_increase_forum_reply_count_hidden( $forum_id = 0 )   X-Ref
Increase the total hidden reply count of a forum by one.

return: void
param: int $forum_id The forum id.
since: 2.6.0 bbPress (r6036)

bbp_decrease_forum_reply_count_hidden( $forum_id = 0 )   X-Ref
Decrease the total hidden reply count of a forum by one.

return: void
param: int $forum_id The forum id.
since: 2.6.0 bbPress (r6036)

bbp_approved_unapproved_topic_update_forum_reply_count( $topic_id = 0 )   X-Ref
Update forum reply counts when a topic is approved or unapproved.

return: void
param: int $topic_id The topic id.
since: 2.6.0 bbPress (r6036)

bbp_update_forum_last_topic_id( $forum_id = 0, $topic_id = 0 )   X-Ref
Update the forum last topic id

return: int Id of the forums most recent topic
param: int $forum_id Optional. Forum id.
param: int $topic_id Optional. Topic id.
since: 2.0.0 bbPress (r2625)

bbp_update_forum_last_reply_id( $forum_id = 0, $reply_id = 0 )   X-Ref
Update the forum last reply id

return: int Id of the forums most recent reply
param: int $forum_id Optional. Forum id.
param: int $reply_id Optional. Reply id.
since: 2.0.0 bbPress (r2625)

bbp_update_forum_last_active_id( $forum_id = 0, $active_id = 0 )   X-Ref
Update the forum last active post id

return: int Id of the forums last active post
param: int $forum_id Optional. Forum id.
param: int $active_id Optional. Active post id.
since: 2.0.0 bbPress (r2860)

bbp_update_forum_last_active_time( $forum_id = 0, $new_time = '' )   X-Ref
Update the forums last active date/time (aka freshness)

return: string MySQL timestamp of last active topic or reply
param: int    $forum_id Optional. Topic id.
param: string $new_time Optional. New time in mysql format.
since: 2.0.0 bbPress (r2680)

bbp_update_forum_subforum_count( $forum_id = 0, $subforums = false )   X-Ref
Update the forum sub-forum count

return: bool True on success, false on failure
param: int $forum_id Optional. Forum id
param: int $subforums Optional. Number of subforums
since: 2.0.0 bbPress (r2625)

bbp_update_forum_topic_count( $forum_id = 0 )   X-Ref
Adjust the total topic count of a forum

return: int Forum topic count
param: int $forum_id Optional. Forum id or topic id. It is checked whether it
param: bool $total_count Optional. To return the total count or normal count?
since: 2.0.0 bbPress (r2464)

bbp_update_forum_topic_count_hidden( $forum_id = 0, $topic_count = false )   X-Ref
Adjust the total hidden topic count of a forum (hidden includes trashed,
spammed and pending topics)

return: int Topic hidden topic count
param: int $forum_id Optional. Topic id to update.
param: int $topic_count Optional. Set the topic count manually.
since: 2.0.0 bbPress (r2888)
since: 2.6.0 bbPress (r5954) Replace direct queries with WP_Query() objects

bbp_update_forum_reply_count( $forum_id = 0 )   X-Ref
Adjust the total reply count of a forum

return: int Forum reply count
param: int  $forum_id Optional. Forum id or topic id. It is checked whether it
since: 2.0.0 bbPress (r2464)
since: 2.6.0 bbPress (r5954) Replace direct queries with WP_Query() objects

bbp_update_forum_reply_count_hidden( $forum_id = 0 )   X-Ref
Adjust the total hidden reply count of a forum

return: int Forum reply count
param: int  $forum_id Optional. Forum id or topic id. It is checked whether it
since: 2.6.0 bbPress (r6922)

bbp_update_forum( $args = array()   X-Ref
Updates the counts of a forum.

This calls a few internal functions that all run manual queries against the
database to get their results. As such, this function can be costly to run
but is necessary to keep everything accurate.

param: array $args Supports these arguments:
since: 2.0.0 bbPress (r2908)

bbp_get_forum_statuses( $forum_id = 0 )   X-Ref
Return an associative array of available topic statuses

Developers note: these statuses are actually stored as meta data, and
Visibilities are stored in post_status.

return: array
param: int $forum_id   Optional. Forum id.
since: 2.4.0 bbPress (r5059)

bbp_get_forum_types( $forum_id = 0 )   X-Ref
Return an associative array of forum types

return: array
param: int $forum_id   Optional. Forum id.
since: 2.4.0 bbPress (r5059)

bbp_get_forum_visibilities( $forum_id = 0)   X-Ref
Return an associative array of forum visibility

Developers note: these visibilities are actually stored in post_status, and
Statuses are stored in meta data.

return: array
param: int $forum_id   Optional. Forum id.
since: 2.4.0 bbPress (r5059)

bbp_get_public_forum_statuses()   X-Ref
Return array of public forum statuses.

return: array
since: 2.6.0 bbPress (r6921)

bbp_get_non_public_forum_statuses()   X-Ref
Return array of non-public forum statuses.

return: array
since: 2.6.0 bbPress (r6921)

bbp_get_hidden_forum_ids()   X-Ref
Returns the hidden forum ids

Only hidden forum ids are returned. Public and private ids are not.

since: 2.0.0 bbPress (r3007)

bbp_get_private_forum_ids()   X-Ref
Returns the private forum ids

Only private forum ids are returned. Public and hidden ids are not.

since: 2.0.0 bbPress (r3007)

bbp_get_excluded_forum_ids()   X-Ref
Returns the forum IDs that should be excluded from various views & queries,
based on the current user's capabilities.

return: array Forum IDs to exclude, or an empty array
since: 2.6.0 bbPress (r6425)

bbp_exclude_forum_ids( $type = 'string' )   X-Ref
Returns a meta_query that either includes or excludes hidden forum IDs
from a query.

param: string Optional. The type of value to return. (string|array|meta_query)
since: 2.0.0 bbPress (r3291)

bbp_pre_get_posts_normalize_forum_visibility( $posts_query = null )   X-Ref
Adjusts forum, topic, and reply queries to exclude items that might be
contained inside hidden or private forums that the user does not have the
capability to view.

Doing it with an action allows us to trap all WP_Query's rather than needing
to hardcode this logic into each query. It also protects forum content for
plugins that might be doing their own queries.

return: WP_Query
param: WP_Query $posts_query
since: 2.0.0 bbPress (r3291)

bbp_forum_query_topic_ids( $forum_id )   X-Ref
Returns the forum's topic ids

Only topics with published and closed statuses are returned

param: int $forum_id Forum id
since: 2.0.0 bbPress (r2908)

bbp_forum_query_subforum_ids( $forum_id )   X-Ref
Returns the forum's subforum ids

Only forums with published status are returned

param: int $forum_id Forum id
since: 2.0.0 bbPress (r2908)

bbp_forum_query_last_reply_id( $forum_id = 0, $topic_ids = 0 )   X-Ref
Returns the forum's last reply id

param: int $forum_id Forum id.
param: int $topic_ids Optional. Topic ids.
since: 2.0.0 bbPress (r2908)
since: 2.6.0 bbPress (r5954) Replace direct queries with WP_Query() objects

bbp_forum_enforce_hidden()   X-Ref
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

since: 2.0.0 bbPress (r2996)

bbp_forum_enforce_private()   X-Ref
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

since: 2.0.0 bbPress (r2996)

bbp_check_forum_edit()   X-Ref
Redirect if unauthorized user is attempting to edit a forum

since: 2.1.0 bbPress (r3607)

bbp_delete_forum_topics( $forum_id = 0 )   X-Ref
Delete all topics (and their replies) for a specific forum ID

return: If forum is not valid
param: int $forum_id
since: 2.1.0 bbPress (r3668)

bbp_trash_forum_topics( $forum_id = 0 )   X-Ref
Trash all topics inside a forum

return: If forum is not valid
param: int $forum_id
since: 2.1.0 bbPress (r3668)

bbp_untrash_forum_topics( $forum_id = 0 )   X-Ref
Untrash all topics inside a forum

return: If forum is not valid
param: int $forum_id
since: 2.1.0 bbPress (r3668)

bbp_delete_forum( $forum_id = 0 )   X-Ref
Called before deleting a forum.

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.

since: 2.1.0 bbPress (r3668)

bbp_trash_forum( $forum_id = 0 )   X-Ref
Called before trashing a forum

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

since: 2.1.0 bbPress (r3668)

bbp_untrash_forum( $forum_id = 0 )   X-Ref
Called before untrashing a forum

since: 2.1.0 bbPress (r3668)

bbp_deleted_forum( $forum_id = 0 )   X-Ref
Called after deleting a forum

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

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

bbp_trashed_forum( $forum_id = 0 )   X-Ref
Called after trashing a forum

since: 2.1.0 bbPress (r3668)

bbp_untrashed_forum( $forum_id = 0 )   X-Ref
Called after untrashing a forum

since: 2.1.0 bbPress (r3668)



Generated: Tue Nov 19 01:01:25 2019 Cross-referenced by PHPXref 0.7.1