Changeset 4503
- Timestamp:
- 11/24/2012 07:19:06 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/forums/template-tags.php
r4502 r4503 677 677 678 678 // Defaults and arguments 679 $ defaults = array(679 $r = bbp_parse_args( $args, array( 680 680 'before' => '<ul class="bbp-forums-list">', 681 681 'after' => '</ul>', … … 689 689 'show_topic_count' => true, 690 690 'show_reply_count' => true, 691 ); 692 $r = bbp_parse_args( $args, $defaults, 'list_forums' ); 693 extract( $r, EXTR_SKIP ); 691 ), 'list_forums' ); 694 692 695 693 // Bail if there are no subforums 696 if ( !bbp_get_forum_subforum_count( $ forum_id, false ) )694 if ( !bbp_get_forum_subforum_count( $r['forum_id'], false ) ) 697 695 return; 698 696 699 697 // Loop through forums and create a list 700 $sub_forums = bbp_forum_get_subforums( $ forum_id);698 $sub_forums = bbp_forum_get_subforums( $r['forum_id'] ); 701 699 if ( !empty( $sub_forums ) ) { 702 700 … … 708 706 // Get forum details 709 707 $count = array(); 710 $show_sep = $total_subs > $i ? $ separator: '';708 $show_sep = $total_subs > $i ? $r['separator'] : ''; 711 709 $permalink = bbp_get_forum_permalink( $sub_forum->ID ); 712 710 $title = bbp_get_forum_title( $sub_forum->ID ); 713 711 714 712 // Show topic count 715 if ( !empty( $ show_topic_count) && !bbp_is_forum_category( $sub_forum->ID ) ) {713 if ( !empty( $r['show_topic_count'] ) && !bbp_is_forum_category( $sub_forum->ID ) ) { 716 714 $count['topic'] = bbp_get_forum_topic_count( $sub_forum->ID ); 717 715 } 718 716 719 717 // Show reply count 720 if ( !empty( $ show_reply_count) && !bbp_is_forum_category( $sub_forum->ID ) ) {718 if ( !empty( $r['show_reply_count'] ) && !bbp_is_forum_category( $sub_forum->ID ) ) { 721 719 $count['reply'] = bbp_get_forum_reply_count( $sub_forum->ID ); 722 720 } … … 724 722 // Counts to show 725 723 if ( !empty( $count ) ) { 726 $counts = $ count_before . implode( $count_sep, $count ) . $count_after;724 $counts = $r['count_before'] . implode( $r['count_sep'], $count ) . $r['count_after']; 727 725 } 728 726 729 727 // Build this sub forums link 730 $output .= $ link_before . '<a href="' . $permalink . '" class="bbp-forum-link">' . $title . $counts . '</a>' . $show_sep . $link_after;728 $output .= $r['link_before'] . '<a href="' . $permalink . '" class="bbp-forum-link">' . $title . $counts . '</a>' . $show_sep . $r['link_after']; 731 729 } 732 730 733 731 // Output the list 734 echo apply_filters( 'bbp_list_forums', $ before . $output . $after, $args);732 echo apply_filters( 'bbp_list_forums', $r['before'] . $output . $r['after'], $r ); 735 733 } 736 734 }
Note: See TracChangeset
for help on using the changeset viewer.