Skip to:
Content

bbPress.org

Ticket #2153: 2153.1.diff

File 2153.1.diff, 1.6 KB (added by jmdodd, 12 years ago)
  • includes/common/template-tags.php

     
    13031303                        'selected'           => 0,
    13041304                        'sort_column'        => 'menu_order',
    13051305                        'post_parent'        => 0,
     1306                        'child_of'           => 0,
    13061307                        'exclude'            => array(),
    13071308                        'numberposts'        => -1,
    13081309                        'orderby'            => 'menu_order',
     
    13661367                $tab       = (int) $r['tab'];
    13671368                $retval    = '';
    13681369                $disabled  = disabled( isset( bbpress()->options[$r['disabled']] ), true, false );
    1369                 $posts     = get_pages( array(
     1370
     1371                $args      = array(
    13701372                        'post_type'          => $r['post_type'],
    13711373                        'post_status'        => $r['post_status'],
    13721374                        'sort_column'        => $r['sort_column'],
    1373                         'post_parent'        => $r['post_parent'],
     1375                        'post_parent'        => $r['post_parent'], // Cheating, get_pages() uses 'parent', not 'post_parent'
     1376                        'child_of'           => $r['child_of'],    // Cheating, get_posts() doesn't have 'child_of'
    13741377                        'exclude'            => $r['exclude'],
    13751378                        'numberposts'        => $r['numberposts'],
    13761379                        'orderby'            => $r['orderby'],
    13771380                        'order'              => $r['order'],
    13781381                        'walker'             => $r['walker'],
    13791382                        'disable_categories' => $r['disable_categories']
    1380                 ) );
     1383                );
    13811384
     1385                // Use get_posts for non-hierarchical topics
     1386                if ( $args['post_type'] == bbp_get_topic_post_type() )
     1387                        $posts = get_posts( $args );
     1388
     1389                // Use get_pages for forums
     1390                else
     1391                        $posts = get_pages( $args );
     1392
    13821393                /** Drop Down *********************************************************/
    13831394
    13841395                // Items found