Make WordPress Core

Ticket #2461: 2461.patch

File 2461.patch, 698 bytes (added by pishmishy, 15 years ago)

Allows depth of tree walk to be set

  • wp-includes/category-template.php

     
    250250                'child_of' => 0, 'feed' => '', 'feed_type' => '',
    251251                'feed_image' => '', 'exclude' => '',
    252252                'hierarchical' => true, 'title_li' => __('Categories'),
    253                 'echo' => 1
     253                'echo' => 1,
     254                'depth' => 0
    254255        );
    255256
    256257        $r = wp_parse_args( $args, $defaults );
     
    289290                        $r['current_category'] = $wp_query->get_queried_object_id();
    290291
    291292                if ( $hierarchical )
    292                         $depth = 0;  // Walk the full depth.
     293                        $depth = $r['depth'];
    293294                else
    294295                        $depth = -1; // Flat.
    295296