83 * @param int|object $category Category ID or category row object. |
83 * @param int|object $category Category ID or category row object. |
84 * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which |
84 * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which |
85 * correspond to a WP_Term object, an associative array, or a numeric array, |
85 * correspond to a WP_Term object, an associative array, or a numeric array, |
86 * respectively. Default OBJECT. |
86 * respectively. Default OBJECT. |
87 * @param string $filter Optional. How to sanitize category fields. Default 'raw'. |
87 * @param string $filter Optional. How to sanitize category fields. Default 'raw'. |
88 * @return object|array|WP_Error|null Category data in type defined by $output parameter. |
88 * @return WP_Term|array|WP_Error|null Category data in type defined by $output parameter. |
89 * WP_Error if $category is empty, null if it does not exist. |
89 * Returns a WP_Term object with backwards compatible property aliases filled in. |
|
90 * WP_Error if $category is empty, null if it does not exist. |
90 */ |
91 */ |
91 function get_category( $category, $output = OBJECT, $filter = 'raw' ) { |
92 function get_category( $category, $output = OBJECT, $filter = 'raw' ) { |
92 $category = get_term( $category, 'category', $output, $filter ); |
93 $category = get_term( $category, 'category', $output, $filter ); |
93 |
94 |
94 if ( is_wp_error( $category ) ) { |
95 if ( is_wp_error( $category ) ) { |