Changeset 27521
- Timestamp:
- 03/13/2014 04:03:06 AM (11 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/category-template.php
r27376 r27521 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 -
trunk/src/wp-includes/category.php
r25880 r27521 86 86 * @param string $output Optional. Constant OBJECT, ARRAY_A, or ARRAY_N 87 87 * @param string $filter Optional. Default is raw or no WordPress defined filter will applied. 88 * @return mixed Category data in type defined by $output parameter.88 * @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. 89 89 */ 90 90 function get_category( $category, $output = OBJECT, $filter = 'raw' ) { 91 91 $category = get_term( $category, 'category', $output, $filter ); 92 92 93 if ( is_wp_error( $category ) ) 93 94 return $category; … … 302 303 * @param string $output Optional. Constant OBJECT, ARRAY_A, or ARRAY_N 303 304 * @param string $filter Optional. Default is raw or no WordPress defined filter will applied. 304 * @return object|array Return type based on $output value.305 * @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. 305 306 */ 306 307 function get_tag( $tag, $output = OBJECT, $filter = 'raw' ) {
Note: See TracChangeset
for help on using the changeset viewer.