Ticket #25429: 25429.2.diff
| File 25429.2.diff, 1018 bytes (added by , 13 years ago) |
|---|
-
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 Category data in type defined by $output parameter. WP_Error if $category 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 87 if ( null === $category ) 88 return new WP_Error( 'invalid_category', __( 'Invalid category' ) ); 89 86 90 _make_cat_compat( $category ); 87 91 88 92 return $category;