Skip to:
Content

bbPress.org


Ignore:
Timestamp:
02/26/2017 06:52:36 AM (8 years ago)
Author:
johnjamesjacoby
Message:

Forums: Introduce bbp_list_forums_subforum_classes filter, to allow filtering of sub-forum links.

Props gordielachance. Fixes #2760.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/forums/template.php

    r6309 r6315  
    783783        $i          = 0;
    784784        $total_subs = count( $sub_forums );
     785
    785786        foreach ( $sub_forums as $sub_forum ) {
    786787            $i++; // Separator count
     
    809810                : '';
    810811
     812            // Subforum classes
     813            $subforum_classes      = array( 'bbp-forum-link' );
     814            $subforum_classes      = apply_filters( 'bbp_list_forums_subforum_classes', $subforum_classes, $sub_forum->ID );
     815            $subforum_classes_attr = 'class="' . implode( ' ', array_map( 'esc_attr', $subforum_classes ) ) . '"';
     816
    811817            // Build this sub forums link
    812             $output .= $r['link_before'] . '<a href="' . esc_url( $permalink ) . '" class="bbp-forum-link">' . $title . $counts . '</a>' . $show_sep . $r['link_after'];
     818            $output .= $r['link_before'] . '<a href="' . esc_url( $permalink ) . '" ' . $subforum_classes_attr . '>' . $title . $counts . '</a>' . $show_sep . $r['link_after'];
    813819        }
    814820    }
Note: See TracChangeset for help on using the changeset viewer.