Skip to:
Content

bbPress.org

Opened 5 years ago

Closed 18 months ago

#2769 closed enhancement (fixed)

function to get the forum id, no matter what the post type is

Reported by: grosbouff Owned by: johnjamesjacoby
Milestone: 2.6 Priority: normal
Severity: normal Version:
Component: Tools - Code Improvements Keywords:
Cc:

Description

Hi,

There should be a function to get the forum id, no matter what the post type is (forum, topic or reply).
This could be used several times in the bbPress core code (where there is a check with a

switch ( get_post_type( $post_id ) ) {
    ...
    case bbp_get_reply_post_type() :
    ...
    case bbp_get_topic_post_type() :
    ...
    case bbp_get_forum_post_type() :
    ...
}

and could be useful in plugins too.

Thanks !

Change History (3)

#1 @johnjamesjacoby
5 years ago

  • Component changed from General to Component - Forums
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Under Consideration
  • Type changed from defect to enhancement

This makes sense. Same is probably true for topics & replies.

#2 @johnjamesjacoby
18 months ago

  • Component changed from Component - Forums to Tools - Code Improvements
  • Keywords needs-patch removed
  • Milestone changed from Under Consideration to 2.6
  • Owner set to johnjamesjacoby

#3 @johnjamesjacoby
18 months ago

  • Resolution set to fixed
  • Status changed from new to closed

In 6814:

Common: introduce bbp_get_post_types() and use where appropriate.

Fixes #2769.

Note: See TracTickets for help on using tickets.