Skip to content

Commit 0a2a18a

Browse files
committed
Docs: Improve @return docblock section for get_category().
This changeset adds more details on the `WP_Term` returned by `get_category()` as it contains additional backwards compatible aliases for the era before WP 4.4 and 2.3. Props apermo, audrasjb. Fixes #62842. See #62281. git-svn-id: https://develop.svn.wordpress.org/trunk@59704 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 1cb2ed2 commit 0a2a18a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/wp-includes/category.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,9 @@ function get_categories( $args = '' ) {
8585
* correspond to a WP_Term object, an associative array, or a numeric array,
8686
* respectively. Default OBJECT.
8787
* @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.
89-
* WP_Error if $category is empty, null if it does not exist.
88+
* @return WP_Term|array|WP_Error|null Category data in type defined by $output parameter.
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.
9091
*/
9192
function get_category( $category, $output = OBJECT, $filter = 'raw' ) {
9293
$category = get_term( $category, 'category', $output, $filter );

0 commit comments

Comments
 (0)