WordPress.org

Make WordPress Core

Ticket #5050: the_category_enhancement.diff

File the_category_enhancement.diff, 964 bytes (added by filosofo, 7 years ago)
  • wp-includes/category-template.php

     
    109109        return $category->name; 
    110110} 
    111111 
    112 function get_the_category_list($separator = '', $parents='') { 
     112function get_the_category_list($separator = '', $parents='', $post_id = false) { 
    113113        global $wp_rewrite; 
    114         $categories = get_the_category(); 
     114        $categories = get_the_category($post_id); 
    115115        if (empty($categories)) 
    116116                return apply_filters('the_category', __('Uncategorized'), $separator, $parents); 
    117117 
     
    179179                return false; 
    180180} 
    181181 
    182 function the_category($separator = '', $parents='') { 
    183         echo get_the_category_list($separator, $parents); 
     182function the_category($separator = '', $parents='', $post_id = false) { 
     183        echo get_the_category_list($separator, $parents, $post_id); 
    184184} 
    185185 
    186186function category_description($category = 0) {