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 | 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)
Change History (5)
#2
@
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/
see https://bbpress.trac.wordpress.org/ticket/2760#ticket