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:
parent
159ea09341
commit
48b96208e2
|
@ -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 = '' ) {
|
||||
|
|
Loading…
Reference in New Issue