Skip to:
Content

bbPress.org

Changeset 4687


Ignore:
Timestamp:
01/07/2013 08:05:20 PM (8 years ago)
Author:
jmdodd
Message:

Refine bbp_get_dropdown().

  • Don't assume post_parent = 0 as a default.
  • Fixes #2153.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/common/template-tags.php

    r4655 r4687  
    13031303            'selected'           => 0,
    13041304            'sort_column'        => 'menu_order',
    1305             'post_parent'        => 0,
    13061305            'exclude'            => array(),
    13071306            'numberposts'        => -1,
     
    13671366        $retval    = '';
    13681367        $disabled  = disabled( isset( bbpress()->options[$r['disabled']] ), true, false );
    1369         $posts     = get_pages( array(
     1368        $post_arr  = array(
    13701369            'post_type'          => $r['post_type'],
    13711370            'post_status'        => $r['post_status'],
    13721371            'sort_column'        => $r['sort_column'],
    1373             'post_parent'        => $r['post_parent'],
    13741372            'exclude'            => $r['exclude'],
    13751373            'numberposts'        => $r['numberposts'],
     
    13781376            'walker'             => $r['walker'],
    13791377            'disable_categories' => $r['disable_categories']
    1380         ) );
     1378        );
     1379        if ( isset( $r['post_parent'] ) )
     1380            $post_arr['post_parent'] = $r['post_parent'];
     1381
     1382        $posts = get_posts( $post_arr );
    13811383
    13821384        /** Drop Down *********************************************************/
Note: See TracChangeset for help on using the changeset viewer.