Opened 11 years ago
Closed 9 years ago
#2760 closed enhancement (fixed)
topics/forums/subforums/replies hentries (and links)... CSS classes should not be hardcoded
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 2.6 | Priority: | normal |
| Severity: | normal | Version: | trunk |
| Component: | API - Actions/Filters | Keywords: | |
| Cc: | gordie.lachance@… |
Description
Hi,
I posted yesterday this bug (https://bbpress.trac.wordpress.org/ticket/2759) but the problem is bigger than that.
I think that it is an absolute necessity (for creating bbPress plugins) that CSS classes for topics/forums/subforums/... entries and links are not hardcoded (eg. bbp-forum-title, bbp-topic-permalink, bbp-reply-permalink, bbp-reply-header, bbp-lead-topic, and others)
This is a real barrier for plugins creator.
Classes for those items should be set like in Wordpress, using the function post_class (http://codex.wordpress.org/Function_Reference/post_class) or a similar one.
We should be able to filter the classes set for topics / forums / subforums / replies, ...
Attachments (1)
Change History (4)
#1
@
11 years ago
- Milestone Awaiting Review deleted
- Priority changed from high to normal
- Resolution set to worksforme
- Status changed from new to closed
#2
@
9 years ago
- Cc gordie.lachance@… added
- Milestone set to 2.6
- Resolution worksforme deleted
- Status changed from closed to reopened
- Version set to trunk
Hi @netweb, the classes still are hardcoded in some places, for example in function bbp_list_forums() :
<?php // Build this sub forums link $output .= $r['link_before'] . '<a href="' . esc_url( $permalink ) . '" class="bbp-forum-link">' . $title . $counts . '</a>' . $show_sep . $r['link_after'];
I made a patch for this one, it is attached to this ticket.
You can already use the following filters:
bbp_get_forum_class,bbp_get_topic_class&bbp_get_reply_classEach of them do mirror WordPress'
post_classfilter: https://codex.wordpress.org/Function_Reference/post_classe.g.
function my_unread_class( $classes ) { $classes[] = 'my-unread-test-class'; return $classes; } add_filter( 'bbp_get_forum_class','my_unread_class' ); add_filter( 'bbp_get_topic_class','my_unread_class' ); add_filter( 'bbp_get_reply_class','my_unread_class' );Related: #2759