Skip to:
Content
Pages
Categories
Search
Top
Bottom

I am confused about ability to add icon next to forum link


  • Chuckie
    Participant

    @ajtruckle

    I saw this discussion:

    a way to check for subforums

    It implied it was fixed in bbpress 2.1:

    https://bbpress.trac.wordpress.org/ticket/1803

    But I don’t get it.

    This is a sub forum with child forums:

    <a class="bbp-forum-title" href="https://www.publictalksoftware.co.uk/support-forums/forum/meeting-schedule-assistant/midweek-editor/">Midweek Editor</a>

    This is a forum with no child forums:

    <a class="bbp-forum-title" href="https://www.publictalksoftware.co.uk/support-forums/forum/meeting-schedule-assistant/assignments-editor/">Assignments Editor</a>

    As you can see, the code is exactly the same. I understood from the associated discussion that the forum with child forums would have a additional class specified so that we could use pseudo before / after to add a symbol to indicate it is a forum with sub forums.

    Or do I have to go about this differently?

    I am using bbp style pack.

    Thanks for shedding any light on this.

Viewing 4 replies - 1 through 4 (of 4 total)

  • Chuckie
    Participant

    @ajtruckle

    According to the trac it states:

    Add bbp-has-subforums if forum has subforums

    Why am I not seeing this class present in the latest version of bbPress 2.6.4?


    Chuckie
    Participant

    @ajtruckle

    Any clarification about this please? Thanks.


    raviousprime
    Participant

    @raviousprime

    This is Test


    Robin W
    Moderator

    @robin-w

    the includes/forum/template.php has a function called bbp_get_forum_class which adds classes, but as far as I can see it is never used.

    bbp_list_forums in the same template has

    // Subforum classes
    			$subforum_classes      = array( 'bbp-forum-link' );
    			$subforum_classes      = apply_filters( 'bbp_list_forums_subforum_classes', $subforum_classes, $sub_forum->ID );
    
    			// This could use bbp_get_forum_class() eventually...
    			$subforum_classes_attr = 'class="' . implode( ' ', array_map( 'sanitize_html_class', $subforum_classes ) ) . '"';

    so looks like this is a plan?

    anyway you could use the line listed above

    $subforum_classes = apply_filters( 'bbp_list_forums_subforum_classes', $subforum_classes, $sub_forum->ID );

    to add a call to that function

    sorry that’s then best I can do

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar