Make WordPress Core


Ignore:
Timestamp:
10/02/2013 07:58:50 PM (11 years ago)
Author:
wonderboymusic
Message:

Rather than adding a taxonomy arg to get_category(), convert all uses of get_category() in core to get_term(). By doing so, we negate the need to call _make_cat_compat() in a few places that are only looking for a single property.

Fixes #8722.

File:
1 edited

Legend:

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

    r25641 r25662  
    4242function get_category_parents( $id, $link = false, $separator = '/', $nicename = false, $visited = array() ) {
    4343    $chain = '';
    44     $parent = get_category( $id );
     44    $parent = get_term( $id, 'category' );
    4545    if ( is_wp_error( $parent ) )
    4646        return $parent;
     
    136136function get_the_category_by_ID( $cat_ID ) {
    137137    $cat_ID = (int) $cat_ID;
    138     $category = get_category( $cat_ID );
     138    $category = get_term( $cat_ID, 'category' );
    139139    if ( is_wp_error( $category ) )
    140140        return $category;
Note: See TracChangeset for help on using the changeset viewer.