WordPress.org

Make WordPress Core

Ticket #8722: 8722.diff

File 8722.diff, 991 bytes (added by wojtek.szkutnik, 4 years ago)
  • category.php

     
    7676 * @param int|object $category Category ID or Category row object 
    7777 * @param string $output Optional. Constant OBJECT, ARRAY_A, or ARRAY_N 
    7878 * @param string $filter Optional. Default is raw or no WordPress defined filter will applied. 
     79 * @param string $taxonomy Optional. Default is 'category'. 
    7980 * @return mixed Category data in type defined by $output parameter. 
    8081 */ 
    81 function &get_category( $category, $output = OBJECT, $filter = 'raw' ) { 
    82         $category = get_term( $category, 'category', $output, $filter ); 
     82function &get_category( $category, $output = OBJECT, $filter = 'raw', $taxonomy = 'category' ) { 
     83        $taxonomy = apply_filters( 'get_category_taxonomy', $taxonomy, $category ); 
     84        $category = get_term( $category, $taxonomy, $output, $filter ); 
    8385        if ( is_wp_error( $category ) ) 
    8486                return $category; 
    8587