Add echo or return option to wp_list_categories. Props Otto42. fixes #4182

git-svn-id: https://develop.svn.wordpress.org/trunk@6091 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2007-09-12 02:53:27 +00:00
parent 7fd1d0c06d
commit a6fba8edcf
1 changed files with 8 additions and 2 deletions

View File

@ -241,7 +241,8 @@ function wp_list_categories($args = '') {
'hide_empty' => 1, 'use_desc_for_title' => 1,
'child_of' => 0, 'feed' => '',
'feed_image' => '', 'exclude' => '',
'hierarchical' => true, 'title_li' => __('Categories')
'hierarchical' => true, 'title_li' => __('Categories'),
'echo' => 1
);
$r = wp_parse_args( $args, $defaults );
@ -290,7 +291,12 @@ function wp_list_categories($args = '') {
if ( $title_li && 'list' == $style )
$output .= '</ul></li>';
echo apply_filters('wp_list_categories', $output);
$output = apply_filters('wp_list_categories', $output);
if ( $echo )
echo $output;
else
return $output;
}
function wp_tag_cloud( $args = '' ) {