Ticket #25429: 25429.4.diff
| File 25429.4.diff, 1.9 KB (added by , 13 years ago) |
|---|
-
src/wp-includes/category-template.php
136 136 function get_the_category_by_ID( $cat_ID ) { 137 137 $cat_ID = (int) $cat_ID; 138 138 $category = get_term( $cat_ID, 'category' ); 139 139 140 if ( is_wp_error( $category ) ) 140 141 return $category; 141 return $category->name; 142 143 return ( $category ) ? $category->name : ''; 142 144 } 143 145 144 146 /** -
src/wp-includes/category.php
76 76 * @param int|object $category Category ID or Category row object 77 77 * @param string $output Optional. Constant OBJECT, ARRAY_A, or ARRAY_N 78 78 * @param string $filter Optional. Default is raw or no WordPress defined filter will applied. 79 * @return mixed Category data in type defined by $output parameter.79 * @return object|array|WP_Error|null Category data in type defined by $output parameter. WP_Error if $category is empty, null if it does not exist. 80 80 */ 81 81 function get_category( $category, $output = OBJECT, $filter = 'raw' ) { 82 82 $category = get_term( $category, 'category', $output, $filter ); 83 83 84 if ( is_wp_error( $category ) ) 84 85 return $category; 85 86 … … 284 285 * @param int|object $tag 285 286 * @param string $output Optional. Constant OBJECT, ARRAY_A, or ARRAY_N 286 287 * @param string $filter Optional. Default is raw or no WordPress defined filter will applied. 287 * @return object|array Return type based on $output value.288 * @return object|array|WP_Error|null Tag data in type defined by $output parameter. WP_Error if $tag is empty, null if it does not exist. 288 289 */ 289 290 function get_tag( $tag, $output = OBJECT, $filter = 'raw' ) { 290 291 return get_term( $tag, 'post_tag', $output, $filter );