Make WordPress Core

Ticket #769: echo-param-of-the-category-func.diff

File echo-param-of-the-category-func.diff, 802 bytes (added by nbachiyski, 21 years ago)
  • wp-includes/template-functions-category.php

    old new  
    4343    return $catlink;
    4444}
    4545
    46 function the_category($separator = '', $parents='') {
     46function the_category($separator = '', $parents='', $echo = true) {
    4747    $categories = get_the_category();
    4848    if (empty($categories)) {
    4949        _e('Uncategorized');
     
    9898            ++$i;
    9999        }
    100100    }
    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;
    102106}
    103107
    104108function get_the_category_by_ID($cat_ID) {
     
    413417        else
    414418                return false;
    415419}
    416 ?>
    417  No newline at end of file
     420?>