[ Index ]

PHP Cross Reference of BBPress

title

Body

[close]

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

bbPress Topic Functions

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

Defines 69 functions

  bbp_insert_topic()
  bbp_new_topic_handler()
  bbp_edit_topic_handler()
  bbp_update_topic()
  bbp_update_topic_walker()
  bbp_move_topic_handler()
  bbp_merge_topic_handler()
  bbp_merge_topic_count()
  bbp_split_topic_handler()
  bbp_split_topic_count()
  bbp_edit_topic_tag_handler()
  bbp_get_topic_statuses()
  bbp_get_topic_types()
  bbp_get_topic_toggles()
  bbp_get_public_topic_statuses()
  bbp_get_non_public_topic_statuses()
  bbp_get_stickies()
  bbp_get_super_stickies()
  bbp_toggle_topic_handler()
  bbp_toggle_topic()
  bbp_remove_topic_from_all_favorites()
  bbp_remove_topic_from_all_subscriptions()
  bbp_bump_topic_reply_count()
  bbp_increase_topic_reply_count()
  bbp_decrease_topic_reply_count()
  bbp_bump_topic_reply_count_hidden()
  bbp_increase_topic_reply_count_hidden()
  bbp_decrease_topic_reply_count_hidden()
  bbp_insert_topic_update_counts()
  bbp_update_topic_forum_id()
  bbp_update_topic_topic_id()
  bbp_update_topic_reply_count()
  bbp_update_topic_reply_count_hidden()
  bbp_update_topic_last_active_id()
  bbp_update_topic_last_active_time()
  bbp_update_topic_last_reply_id()
  bbp_update_topic_voice_count()
  bbp_update_topic_anonymous_reply_count()
  bbp_update_topic_revision_log()
  bbp_close_topic()
  bbp_open_topic()
  bbp_spam_topic()
  bbp_spam_topic_replies()
  bbp_spam_topic_tags()
  bbp_unspam_topic()
  bbp_unspam_topic_replies()
  bbp_unspam_topic_tags()
  bbp_stick_topic()
  bbp_approve_topic()
  bbp_unapprove_topic()
  bbp_unstick_topic()
  bbp_delete_topic()
  bbp_delete_topic_replies()
  bbp_trash_topic()
  bbp_trash_topic_replies()
  bbp_untrash_topic()
  bbp_untrash_topic_replies()
  bbp_deleted_topic()
  bbp_trashed_topic()
  bbp_untrashed_topic()
  bbp_get_topics_per_page()
  bbp_get_topics_per_rss_page()
  bbp_get_topic_tags()
  bbp_get_topic_tag_names()
  bbp_update_topic_tag_count()
  bbp_topic_content_autoembed()
  bbp_display_topics_feed_rss2()
  bbp_check_topic_edit()
  bbp_check_topic_tag_edit()

Functions
Functions that are not part of a class:

bbp_insert_topic( $topic_data = array()   X-Ref
A wrapper for wp_insert_post() that also includes the necessary meta values
for the topic to function properly.

since: 2.0.0 bbPress (r3349)
param: array $topic_data Forum post data
param: array $topic_meta Forum meta data

bbp_new_topic_handler( $action = '' )   X-Ref
Handles the front end topic submission

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

bbp_edit_topic_handler( $action = '' )   X-Ref
Handles the front end edit topic submission

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

bbp_update_topic( $topic_id = 0, $forum_id = 0, $anonymous_data = array()   X-Ref
Handle all the extra meta stuff from posting a new topic

param: int $topic_id Optional. Topic id
param: int $forum_id Optional. Forum id
param: array $anonymous_data Optional - if it's an anonymous post. Do not
param: int $author_id Author id
param: bool $is_edit Optional. Is the post being edited? Defaults to false.

bbp_update_topic_walker( $topic_id, $last_active_time = '', $forum_id = 0, $reply_id = 0, $refresh = true )   X-Ref
Walks up the post_parent tree from the current topic_id, and updates the
meta data of forums above it. This calls several 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.

since: 2.0.0 bbPress (r2800)
param: int $topic_id Topic id
param: string $last_active_time Optional. Last active time
param: int $forum_id Optional. Forum id
param: int $reply_id Optional. Reply id
param: bool $refresh Reset all the previous parameters? Defaults to true.

bbp_move_topic_handler( $topic_id, $old_forum_id, $new_forum_id )   X-Ref
Handle the moving of a topic from one forum to another. This includes walking
up the old and new branches and updating the counts.

since: 2.0.0 bbPress (r2907)
param: int $topic_id     The topic id.
param: int $old_forum_id Old forum id.
param: int $new_forum_id New forum id.

bbp_merge_topic_handler( $action = '' )   X-Ref
Merge topic handler

Handles the front end merge topic submission

since: 2.0.0 bbPress (r2756)
param: string $action The requested action to compare this function to

bbp_merge_topic_count( $destination_topic_id, $source_topic_id, $source_topic_forum_id )   X-Ref
Fix counts on topic merge

When a topic is merged, update the counts of source and destination topic
and their forums.

since: 2.0.0 bbPress (r2756)
param: int $destination_topic_id Destination topic id
param: int $source_topic_id Source topic id
param: int $source_topic_forum_id Source topic's forum id

bbp_split_topic_handler( $action = '' )   X-Ref
Split topic handler

Handles the front end split topic submission

since: 2.0.0 bbPress (r2756)
param: string $action The requested action to compare this function to

bbp_split_topic_count( $from_reply_id, $source_topic_id, $destination_topic_id )   X-Ref
Fix counts on topic split

When a topic is split, update the counts of source and destination topic
and their forums.

since: 2.0.0 bbPress (r2756)
param: int $from_reply_id From reply id
param: int $source_topic_id Source topic id
param: int $destination_topic_id Destination topic id

bbp_edit_topic_tag_handler( $action = '' )   X-Ref
Handles the front end tag management (renaming, merging, destroying)

since: 2.0.0 bbPress (r2768)
param: string $action The requested action to compare this function to

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

since: 2.4.0 bbPress (r5059)
param: int $topic_id   Optional. Topic id.
return: array

bbp_get_topic_types( $topic_id = 0 )   X-Ref
Return an associative array of topic sticky types

since: 2.4.0 bbPress (r5059)
param: int $topic_id   Optional. Topic id.
return: array

bbp_get_topic_toggles( $topic_id = 0 )   X-Ref
Return array of available topic toggle actions

since: 2.6.0 bbPress (r6133)
param: int $topic_id   Optional. Topic id.
return: array

bbp_get_public_topic_statuses()   X-Ref
Return array of public topic statuses.

since: 2.6.0 bbPress (r6383)
return: array

bbp_get_non_public_topic_statuses()   X-Ref
Return array of non-public topic statuses.

since: 2.6.0 bbPress (r6642)
return: array

bbp_get_stickies( $forum_id = 0 )   X-Ref
Return sticky topics of a forum

since: 2.0.0 bbPress (r2592)
param: int $forum_id Optional. If not passed, super stickies are returned.
return: array IDs of sticky topics of a forum or super stickies

bbp_get_super_stickies()   X-Ref
Return topics stuck to front page of the forums

since: 2.0.0 bbPress (r2592)
return: array IDs of super sticky topics

bbp_toggle_topic_handler( $action = '' )   X-Ref
Handles the front end opening/closing, spamming/unspamming,
sticking/unsticking and trashing/untrashing/deleting of topics

since: 2.0.0 bbPress (r2727)
param: string $action The requested action to compare this function to

bbp_toggle_topic( $args = array()   X-Ref
Do the actual topic toggling

This function is used by `bbp_toggle_topic_handler()` to do the actual heavy
lifting when it comes to toggling topic. It only really makes sense to call
within that context, so if you need to call this function directly, make sure
you're also doing what the handler does too.

since: 2.6.0  bbPress (r6133)
param: array $args

bbp_remove_topic_from_all_favorites( $topic_id = 0 )   X-Ref
Remove a deleted topic from all user favorites

since: 2.0.0 bbPress (r2652)
param: int $topic_id Get the topic id to remove

bbp_remove_topic_from_all_subscriptions( $topic_id = 0 )   X-Ref
Remove a deleted topic from all user subscriptions

since: 2.0.0 bbPress (r2652)
param: int $topic_id Get the topic id to remove

bbp_bump_topic_reply_count( $topic_id = 0, $difference = 1 )   X-Ref
Bump the total reply count of a topic

since: 2.1.0 bbPress (r3825)
param: int $topic_id   Optional. Topic id.
param: int $difference Optional. Default 1
return: int Topic reply count

bbp_increase_topic_reply_count( $topic_id = 0 )   X-Ref
Increase the total reply count of a topic by one.

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

bbp_decrease_topic_reply_count( $topic_id = 0 )   X-Ref
Decrease the total reply count of a topic by one.

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

bbp_bump_topic_reply_count_hidden( $topic_id = 0, $difference = 1 )   X-Ref
Bump the total hidden reply count of a topic

since: 2.1.0 bbPress (r3825)
param: int $topic_id   Optional. Topic id.
param: int $difference Optional. Default 1
return: int Topic hidden reply count

bbp_increase_topic_reply_count_hidden( $topic_id = 0 )   X-Ref
Increase the total hidden reply count of a topic by one.

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

bbp_decrease_topic_reply_count_hidden( $topic_id = 0 )   X-Ref
Decrease the total hidden reply count of a topic by one.

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

bbp_insert_topic_update_counts( $topic_id = 0, $forum_id = 0 )   X-Ref
Update counts after a topic is inserted via `bbp_insert_topic`.

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

bbp_update_topic_forum_id( $topic_id = 0, $forum_id = 0 )   X-Ref
Update the topic's forum id

since: 2.0.0 bbPress (r2855)
param: int $topic_id Optional. Topic id to update
param: int $forum_id Optional. Forum id
return: int Forum id

bbp_update_topic_topic_id( $topic_id = 0 )   X-Ref
Update the topic's topic id

since: 2.0.0 bbPress (r2954)
param: int $topic_id Optional. Topic id to update
return: int Topic id

bbp_update_topic_reply_count( $topic_id = 0, $reply_count = false )   X-Ref
Adjust the total reply count of a topic

since: 2.0.0 bbPress (r2467)
param: int $topic_id Optional. Topic id to update
param: int $reply_count Optional. Set the reply count manually.
return: int Topic reply count

bbp_update_topic_reply_count_hidden( $topic_id = 0, $reply_count = false )   X-Ref
Adjust the total hidden reply count of a topic (hidden includes trashed,
spammed and pending replies)

since: 2.0.0 bbPress (r2740)
param: int $topic_id Optional. Topic id to update
param: int $reply_count Optional. Set the reply count manually
return: int Topic hidden reply count

bbp_update_topic_last_active_id( $topic_id = 0, $active_id = 0 )   X-Ref
Update the topic with the last active post ID

since: 2.0.0 bbPress (r2888)
param: int $topic_id Optional. Topic id to update
param: int $active_id Optional. active id
return: int Active id

bbp_update_topic_last_active_time( $topic_id = 0, $new_time = '' )   X-Ref
Update the topics last active date/time (aka freshness)

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

bbp_update_topic_last_reply_id( $topic_id = 0, $reply_id = 0 )   X-Ref
Update the topic with the most recent reply ID

since: 2.0.0 bbPress (r2625)
param: int $topic_id Optional. Topic id to update
param: int $reply_id Optional. Reply id
return: int Reply id

bbp_update_topic_voice_count( $topic_id = 0 )   X-Ref
Adjust the total voice count of a topic

since: 2.0.0 bbPress (r2567)
since: 2.6.0 bbPress (r6515) This must be called after any engagement changes
param: int $topic_id Optional. Topic id to update
return: int Voice count

bbp_update_topic_anonymous_reply_count( $topic_id = 0 )   X-Ref
Adjust the total anonymous reply count of a topic

since: 2.0.0 bbPress (r2567)
param: int $topic_id Optional. Topic id to update
return: int Anonymous reply count

bbp_update_topic_revision_log( $args = array()   X-Ref
Update the revision log of the topic

since: 2.0.0 bbPress (r2782)
param: array $args Supports these args:
return: mixed False on failure, true on success

bbp_close_topic( $topic_id = 0 )   X-Ref
Closes a topic

since: 2.0.0 bbPress (r2740)
param: int $topic_id Topic id
return: mixed False or {@link WP_Error} on failure, topic id on success

bbp_open_topic( $topic_id = 0 )   X-Ref
Opens a topic

since: 2.0.0 bbPress (r2740)
param: int $topic_id Topic id
return: mixed False or {@link WP_Error} on failure, topic id on success

bbp_spam_topic( $topic_id = 0 )   X-Ref
Marks a topic as spam

since: 2.0.0 bbPress (r2740)
param: int $topic_id Topic id
return: mixed False or {@link WP_Error} on failure, topic id on success

bbp_spam_topic_replies( $topic_id = 0 )   X-Ref
Trash replies to a topic when it's marked as spam

Usually you'll want to do this before the topic itself is marked as spam.

since: 2.6.0 bbPress (r5405)
param: int $topic_id

bbp_spam_topic_tags( $topic_id = 0 )   X-Ref
Store the tags to a topic in post meta before it's marked as spam so they
can be retrieved and unspammed later.

Usually you'll want to do this before the topic itself is marked as spam.

since: 2.6.0 bbPress (r5405)
param: int $topic_id

bbp_unspam_topic( $topic_id = 0 )   X-Ref
Unspams a topic

since: 2.0.0 bbPress (r2740)
param: int $topic_id Topic id
return: mixed False or {@link WP_Error} on failure, topic id on success

bbp_unspam_topic_replies( $topic_id = 0 )   X-Ref
Untrash replies to a topic previously marked as spam.

Usually you'll want to do this after the topic is unspammed.

since: 2.6.0 bbPress (r5405)
param: int $topic_id

bbp_unspam_topic_tags( $topic_id = 0 )   X-Ref
Retrieve tags to a topic from post meta before it's unmarked as spam so they.

Usually you'll want to do this before the topic itself is unmarked as spam.

since: 2.6.0 bbPress (r5405)
param: int $topic_id

bbp_stick_topic( $topic_id = 0, $super = false )   X-Ref
Sticks a topic to a forum or front

since: 2.0.0 bbPress (r2754)
param: int $topic_id Optional. Topic id
param: int $super Should we make the topic a super sticky?
return: bool True on success, false on failure

bbp_approve_topic( $topic_id = 0 )   X-Ref
Approves a pending topic

since: 2.6.0 bbPress (r5503)
param: int $topic_id Topic id
return: mixed False or {@link WP_Error} on failure, topic id on success

bbp_unapprove_topic( $topic_id = 0 )   X-Ref
Unapproves a topic

since: 2.6.0 bbPress (r5503)
param: int $topic_id Topic id
return: mixed False or {@link WP_Error} on failure, topic id on success

bbp_unstick_topic( $topic_id = 0 )   X-Ref
Unsticks a topic both from front and it's forum

since: 2.0.0 bbPress (r2754)
param: int $topic_id Optional. Topic id
return: bool Always true.

bbp_delete_topic( $topic_id = 0 )   X-Ref
Called before deleting a topic.

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.

bbp_delete_topic_replies( $topic_id = 0 )   X-Ref
Delete replies to a topic when it's deleted

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

since: 2.6.0 bbPress (r5405)
param: int $topic_id

bbp_trash_topic( $topic_id = 0 )   X-Ref
Called before trashing a topic

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

bbp_trash_topic_replies( $topic_id = 0 )   X-Ref
Trash replies to a topic when it's trashed.

Usually you'll want to do this before the topic itself is marked as spam.

since: 2.6.0 bbPress (r5405)
param: int $topic_id

bbp_untrash_topic( $topic_id = 0 )   X-Ref
Called before untrashing a topic


bbp_untrash_topic_replies( $topic_id = 0 )   X-Ref
Untrash replies to a topic previously trashed.

Usually you'll want to do this after the topic is unspammed.

since: 2.6.0 bbPress (r5405)
param: int $topic_id

bbp_deleted_topic( $topic_id = 0 )   X-Ref
Called after deleting a topic

since: 2.0.0 bbPress (r2993)

bbp_trashed_topic( $topic_id = 0 )   X-Ref
Called after trashing a topic

since: 2.0.0 bbPress (r2993)

bbp_untrashed_topic( $topic_id = 0 )   X-Ref
Called after untrashing a topic

since: 2.0.0 bbPress (r2993)

bbp_get_topics_per_page( $default = 15 )   X-Ref
Return the topics per page setting

since: 2.0.0 bbPress (r3540)
return: int

bbp_get_topics_per_rss_page( $default = 25 )   X-Ref
Return the topics per RSS page setting

since: 2.0.0 bbPress (r3540)
param: int $default Default replies per page (25)
return: int

bbp_get_topic_tags( $topic_id = 0 )   X-Ref
Get topic tags for a specific topic ID

since: 2.6.0 bbPress (r5836)
param: int $topic_id
return: string

bbp_get_topic_tag_names( $topic_id = 0, $sep = ', ' )   X-Ref
Get topic tags for a specific topic ID

since: 2.2.0 bbPress (r4165)
param: int    $topic_id
param: string $sep
return: string

bbp_update_topic_tag_count( $terms, $taxonomy )   X-Ref
Will update topic-tag count based on object type.

Function for the default callback for topic-tag taxonomies.

since: 2.6.0 bbPress (r6253)
param: array  $terms    List of Term taxonomy IDs.
param: object $taxonomy Current taxonomy object of terms.

bbp_topic_content_autoembed()   X-Ref
Check if autoembeds are enabled and hook them in if so

since: 2.1.0 bbPress (r3752)

bbp_display_topics_feed_rss2( $topics_query = array()   X-Ref
Output an RSS2 feed of topics, based on the query passed.

since: 2.0.0 bbPress (r3171)
param: array $topics_query

bbp_check_topic_edit()   X-Ref
Redirect if unauthorized user is attempting to edit a topic

since: 2.1.0 bbPress (r3605)

bbp_check_topic_tag_edit()   X-Ref
Redirect if unauthorized user is attempting to edit a topic tag

since: 2.1.0 bbPress (r3605)



Generated: Mon Apr 29 01:01:00 2024 Cross-referenced by PHPXref 0.7.1