Skip to:
Content

bbPress.org

Opened 10 years ago

Closed 8 years ago

#2759 closed enhancement (duplicate)

subforum links classes should be generated by a (filterable) function

Reported by: grosbouff's profile grosbouff Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Component - Forums Keywords: has-patch needs-codex
Cc:

Description

in function bbp_list_forums (templates.php),
the class bbp-forum-link is hardcoded.
I made a plugin that checks wether forums/topic/replies/categories... have been already read or not, and I'm stuck because of this hardcoded class.
subforum links classes should be generated by a (filterable) function, like eg.

bbp_get_forum_link_class($forum_id){
  $classes = array('bbp-forum-link');
  $classes = apply_filters('bbp_get_forum_link_class', $classes, $forum_id);
  return implode(' ',$classes);
}

Attachments (1)

2759.diff (1.7 KB) - added by netweb 10 years ago.

Download all attachments as: .zip

Change History (5)

@netweb
10 years ago

#2 @netweb
10 years ago

  • Component changed from General to Component - Forums
  • Keywords has-patch needs-codex added
  • Milestone changed from Awaiting Review to Under Consideration

I think you can achieve the functionality you are looking for with the code example I listed in #2760 for the most part.

That said bbp-forum-link shouldn't be hard coded either.

Attached patch 2759.diff removes the hard coded CSS class for sub forum links and allows you to filter it using bbp_before_list_forums_parse_args, see https://codex.bbpress.org/bbp_list_forums/

#3 @grosbouff
10 years ago

Hi ! Thanks for your reply.
Does that means that attached patch 2759 will be merged into bbPress "official" code ?

#4 @netweb
8 years ago

  • Milestone Under Consideration deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Closing as duplicate of #2760, this was fixed in r6315

Note: See TracTickets for help on using tickets.