Ticket #769: echo-param-of-the-category-func.diff
| File echo-param-of-the-category-func.diff, 802 bytes (added by , 21 years ago) |
|---|
-
wp-includes/template-functions-category.php
old new 43 43 return $catlink; 44 44 } 45 45 46 function the_category($separator = '', $parents='' ) {46 function the_category($separator = '', $parents='', $echo = true) { 47 47 $categories = get_the_category(); 48 48 if (empty($categories)) { 49 49 _e('Uncategorized'); … … 98 98 ++$i; 99 99 } 100 100 } 101 echo apply_filters('the_category', $thelist); 101 $catlist = apply_filters('the_category', $thelist); 102 if ($echo) 103 echo $catlist; 104 else 105 return $catlist; 102 106 } 103 107 104 108 function get_the_category_by_ID($cat_ID) { … … 413 417 else 414 418 return false; 415 419 } 416 ?> 417 No newline at end of file 420 ?>