WordPress.org

Make WordPress Core

Ticket #4182: wp_list_categories_echo.diff

File wp_list_categories_echo.diff, 1020 bytes (added by Otto42, 13 years ago)

Patch to add echo parameter support to wp_list_categories

  • wp-includes/category-template.php

     
    227227                'order' => 'ASC', 'show_last_update' => 0, 'style' => 'list',
    228228                'show_count' => 0, 'hide_empty' => 1, 'use_desc_for_title' => 1,
    229229                'child_of' => 0, 'feed' => '', 'feed_image' => '', 'exclude' => '',
    230                 'hierarchical' => true, 'title_li' => __('Categories'));
     230                'hierarchical' => true, 'title_li' => __('Categories'), 'echo' => 1 );
    231231        $r = array_merge($defaults, $r);
    232232        if ( !isset($r['pad_counts']) && $r['show_count'] && $r['hierarchical'] )
    233233                $r['pad_counts'] = true;
     
    269269        if ( $title_li && 'list' == $style )
    270270                $output .= '</ul></li>';
    271271
    272         echo apply_filters('wp_list_categories', $output);
     272        $output = apply_filters('wp_list_categories', $output);
     273        if ( $r['echo'] ) echo $output;
     274        else return $output;
    273275}
    274276
    275277function wp_tag_cloud( $args = '' ) {