Changeset 6024
- Timestamp:
- 05/10/2016 03:34:28 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/forums/template.php
r5951 r6024 803 803 804 804 // Define used variables 805 $output = $sub_forums = $topic_count = $reply_count = $counts = ''; 806 $i = 0; 807 $count = array(); 805 $output = ''; 808 806 809 807 // Parse arguments against default values … … 827 825 828 826 // Total count (for separator) 827 $i = 0; 829 828 $total_subs = count( $sub_forums ); 830 829 foreach ( $sub_forums as $sub_forum ) { … … 833 832 // Get forum details 834 833 $count = array(); 835 $show_sep = $total_subs > $i ? $r['separator'] : '';836 834 $permalink = bbp_get_forum_permalink( $sub_forum->ID ); 837 835 $title = bbp_get_forum_title( $sub_forum->ID ); 836 $show_sep = ( $total_subs > $i ) 837 ? $r['separator'] 838 : ''; 838 839 839 840 // Show topic count … … 848 849 849 850 // Counts to show 850 if ( ! empty( $count ) ) {851 $counts = $r['count_before'] . implode( $r['count_sep'], $count ) . $r['count_after'];852 }851 $counts = ! empty( $count ) 852 ? $r['count_before'] . implode( $r['count_sep'], $count ) . $r['count_after'] 853 : ''; 853 854 854 855 // Build this sub forums link 855 856 $output .= $r['link_before'] . '<a href="' . esc_url( $permalink ) . '" class="bbp-forum-link">' . $title . $counts . '</a>' . $show_sep . $r['link_after']; 856 857 } 857 858 // Output the list 859 echo apply_filters( 'bbp_list_forums', $r['before'] . $output . $r['after'], $r, $args ); 860 } 858 } 859 860 // Maybe wrap output 861 if ( ! empty( $output ) ) { 862 $output = $r['before'] . $output . $r['after']; 863 } 864 865 // Filter & output the forums list 866 echo apply_filters( 'bbp_list_forums', $output, $r, $args ); 861 867 } 862 868
Note: See TracChangeset
for help on using the changeset viewer.