WordPress.org

Make WordPress Core

Changeset 6899


Ignore:
Timestamp:
02/18/08 17:46:26 (7 years ago)
Author:
ryan
Message:

Add optional post ID arg to the_category and get_the_category_list. Props filosofo. fixes #5050

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/category-template.php

    r6824 r6899  
    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); 
     
    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 
Note: See TracChangeset for help on using the changeset viewer.