[ Index ]

PHP Cross Reference of BBPress

title

Body

[close]

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

bbPress Topic Functions

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

Defines 67 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_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.

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

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
counts of forums above it. 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: 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.
since: 2.0.0 bbPress (r2800)

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.

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

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

Handles the front end merge topic submission

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

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.

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
since: 2.0.0 bbPress (r2756)

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

Handles the front end split topic submission

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

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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

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

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.

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

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

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

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.

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

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.

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

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

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

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

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

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

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

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

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

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.

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

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.

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

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.

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

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

return: int
since: 2.0.0 bbPress (r3540)

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

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

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

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

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

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

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.

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

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.

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

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: Wed Jul 24 01:01:31 2019 Cross-referenced by PHPXref 0.7.1