Changeset 4597 for trunk/includes/forums/template-tags.php
- Timestamp:
- 12/20/2012 10:46:04 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/includes/forums/template-tags.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/forums/template-tags.php
r4579 r4597 643 643 // Parse arguments against default values 644 644 $r = bbp_parse_args( $args, array( 645 'post_parent' => 0, 646 'post_type' => bbp_get_forum_post_type(), 647 'post_status' => implode( ',', $post_stati ), 648 'posts_per_page' => get_option( '_bbp_forums_per_page', 50 ), 649 'orderby' => 'menu_order', 650 'order' => 'ASC' 645 'post_parent' => 0, 646 'post_type' => bbp_get_forum_post_type(), 647 'post_status' => implode( ',', $post_stati ), 648 'posts_per_page' => get_option( '_bbp_forums_per_page', 50 ), 649 'orderby' => 'menu_order', 650 'order' => 'ASC', 651 'ignore_sticky_posts' => true, 652 'no_found_rows' => true 651 653 ), 'forum_get_subforums' ); 652 654 $r['post_parent'] = bbp_get_forum_id( $r['post_parent'] ); 653 655 656 // Create a new query for the subforums 657 $get_posts = new WP_Query(); 658 654 659 // No forum passed 655 $sub_forums = !empty( $r['post_parent'] ) ? get_posts( $r ) : '';656 657 return apply_filters( 'bbp_forum_get_sub_forums', (array)$sub_forums, $args );660 $sub_forums = !empty( $r['post_parent'] ) ? $get_posts->query( $r ) : array(); 661 662 return (array) apply_filters( 'bbp_forum_get_subforums', $sub_forums, $args ); 658 663 } 659 664 … … 699 704 ), 'list_forums' ); 700 705 701 // Bail if there are no subforums702 if ( !bbp_get_forum_subforum_count( $r['forum_id'], false ) )703 return;704 705 706 // Loop through forums and create a list 706 707 $sub_forums = bbp_forum_get_subforums( $r['forum_id'] );
Note: See TracChangeset
for help on using the changeset viewer.