Contents
bbp_get_topic_forum_id( int $topic_id )
Return the forum id a topic belongs to
Description
Parameters
- $topic_id
-
(Optional) Topic id
Return
(int) Topic forum id
Source
File: bp-forums/topics/template.php
function bbp_get_topic_forum_id( $topic_id = 0 ) { $topic_id = bbp_get_topic_id( $topic_id ); $forum_id = get_post_meta( $topic_id, '_bbp_forum_id', true ); return (int) apply_filters( 'bbp_get_topic_forum_id', (int) $forum_id, $topic_id ); }
Changelog
Version | Description |
---|---|
bbPress (r2491) | Introduced. |
Related
Uses
Uses | Description |
---|---|
bp-forums/topics/template.php: bbp_get_topic_id() |
Return the topic id |
Used By | Description |
---|---|
bp-document/classes/class-bp-rest-document-endpoint.php: BP_REST_Document_Endpoint::bbp_document_update_rest_field_callback() |
The function to use to update the document’s value of the topic REST Field. |
bp-document/bp-document-filters.php: bp_document_forums_new_post_document_save() |
Save document when new topic or reply is saved |
bp-media/bp-media-functions.php: bp_media_get_forum_id() | |
bp-media/classes/class-bp-rest-media-endpoint.php: BP_REST_Media_Endpoint::bbp_media_update_rest_field_callback() |
The function to use to update the medias’s value of the topic REST Field. |
bp-forums/classes/class-bp-rest-topics-endpoint.php: BP_REST_Topics_Endpoint::prepare_item_for_response() |
Prepares component data for return as an object. |
bp-forums/classes/class-bp-rest-topics-endpoint.php: BP_REST_Topics_Endpoint::prepare_links() |
Prepare links for the request. |
bp-forums/classes/class-bp-rest-topics-endpoint.php: BP_REST_Topics_Endpoint::get_topic_current_user_permissions() |
Topic permissions for the current user. |
bp-forums/classes/class-bp-rest-topics-actions-endpoint.php: BP_REST_Topics_Actions_Endpoint::merge_item() |
Merge Topic |
bp-forums/classes/class-bp-rest-topics-actions-endpoint.php: BP_REST_Topics_Actions_Endpoint::split_item() |
Split Topic |
bp-forums/classes/class-bp-rest-topics-actions-endpoint.php: BP_REST_Topics_Actions_Endpoint::dropdown_items() |
Topic’s Dropdown |
bp-forums/classes/class-bp-rest-topics-endpoint.php: BP_REST_Topics_Endpoint::update_item() |
Update/Edit a topic. |
bp-forums/classes/class-bp-rest-reply-actions-endpoint.php: BP_REST_Reply_Actions_Endpoint::move_item() |
Move a Reply. |
bp-forums/classes/class-bp-rest-reply-endpoint.php: BP_REST_Reply_Endpoint::create_item() |
Create a reply. |
bp-forums/classes/class-bp-rest-reply-endpoint.php: BP_REST_Reply_Endpoint::update_item() |
Update/Edit a reply. |
bp-forums/admin/tools.php: bbp_admin_repair_sticky() |
Repairs the relationship of sticky topics to the actual parent forum |
bp-forums/admin/metaboxes.php: bbp_topic_metabox() |
Topic metabox |
bp-forums/admin/replies.php: BBP_Replies_Admin::attributes_metabox_save() |
Pass the reply attributes for processing |
bp-forums/admin/replies.php: BBP_Replies_Admin::column_data() |
Print extra columns for the replies page |
bp-forums/admin/topics.php: BBP_Topics_Admin::column_data() |
Print extra columns for the topics page |
bp-forums/topics/template.php: bbp_get_form_topic_forum() |
Return value of topic forum |
bp-forums/topics/template.php: bbp_get_topic_class() |
Return the row class of a topic |
bp-forums/topics/template.php: bbp_topic_forum_id() |
Output the forum id a topic belongs to |
bp-forums/topics/template.php: bbp_get_topic_forum_title() |
Return the title of the forum a topic belongs to |
bp-forums/topics/template.php: bbp_is_topic_sticky() |
Is the topic a sticky or super sticky? |
bp-forums/topics/functions.php: bbp_stick_topic() |
Sticks a topic to a forum or front |
bp-forums/topics/functions.php: bbp_unstick_topic() |
Unsticks a topic both from front and it’s forum |
bp-forums/topics/functions.php: bbp_update_topic() |
Handle all the extra meta stuff from posting a new topic |
bp-forums/topics/functions.php: bbp_update_topic_walker() |
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. |
bp-forums/topics/functions.php: bbp_merge_topic_handler() |
Merge topic handler |
bp-forums/topics/functions.php: bbp_split_topic_handler() |
Split topic handler |
bp-forums/topics/functions.php: bbp_split_topic_count() |
Fix counts on topic split |
bp-forums/topics/functions.php: bbp_insert_topic() |
A wrapper for wp_insert_post() that also includes the necessary meta values for the topic to function properly. |
bp-forums/topics/functions.php: bbp_edit_topic_handler() |
Handles the front end edit topic submission |
bp-forums/groups.php: BBP_Forums_Group_Extension::redirect_canonical() |
Ensure that forum content associated with a BuddyBoss group can only be viewed via the group URL. |
bp-forums/groups.php: BBP_Forums_Group_Extension::map_activity_to_group() |
Map a forum post to its corresponding group in the group activity stream. |
bp-forums/groups.php: BBP_Forums_Group_Extension::maybe_map_permalink_to_group() |
Maybe map a Forums forum/topic/reply permalink to the corresponding group |
bp-forums/forums/template.php: bbp_suppress_private_author_link() |
Replace forum author details for users that cannot view them. |
bp-forums/forums/template.php: bbp_get_forum_id() |
Return the forum id |
bp-forums/forums/functions.php: bbp_forum_enforce_private() |
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 |
bp-forums/forums/functions.php: bbp_forum_enforce_hidden() |
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 |
bp-forums/forums/functions.php: bbp_update_forum_topic_count_hidden() |
Adjust the total hidden topic count of a forum (hidden includes trashed and spammed topics) |
bp-forums/common/shortcodes.php: BBP_Shortcodes::display_topic() |
Display the contents of a specific topic ID in an output buffer and return to ensure that post/page contents are displayed first. |
bp-forums/activity.php: BBP_BuddyPress_Activity::topic_update() |
Update the activity stream entry when a topic status changes |
bp-forums/activity.php: BBP_BuddyPress_Activity::group_forum_topic_activity_action_callback() | |
bp-forums/replies/functions.php: bbp_display_replies_feed_rss2() |
Output an RSS2 feed of replies, based on the query passed. |
bp-forums/replies/functions.php: bbp_move_reply_count() |
Fix counts on reply move |
bp-forums/replies/functions.php: bbp_update_reply() |
Handle all the extra meta stuff from posting a new reply or editing a reply |
bp-forums/replies/functions.php: bbp_move_reply_handler() |
Move reply handler |
bp-forums/replies/functions.php: bbp_new_reply_handler() |
Handles the front end reply submission |
bp-forums/replies/functions.php: bbp_edit_reply_handler() |
Handles the front end edit reply submission |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.