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

git-svn-id: http://svn.automattic.com/wordpress/trunk@6091 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-09-12 02:53:27 +00:00
parent 159ea09341
commit 48b96208e2
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, 'hide_empty' => 1, 'use_desc_for_title' => 1,
'child_of' => 0, 'feed' => '', 'child_of' => 0, 'feed' => '',
'feed_image' => '', 'exclude' => '', 'feed_image' => '', 'exclude' => '',
'hierarchical' => true, 'title_li' => __('Categories') 'hierarchical' => true, 'title_li' => __('Categories'),
'echo' => 1
); );
$r = wp_parse_args( $args, $defaults ); $r = wp_parse_args( $args, $defaults );
@ -290,7 +291,12 @@ function wp_list_categories($args = '') {
if ( $title_li && 'list' == $style ) if ( $title_li && 'list' == $style )
$output .= '</ul></li>'; $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 = '' ) { function wp_tag_cloud( $args = '' ) {