From c1e158cf87b036dd0eb4ff8e542c31c5d0b1e854 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Fri, 17 Jul 2015 22:57:20 +0000 Subject: [PATCH] Update the description for `get_the_category()` with helpful information for the proper function to use for custom taxonomies. Also adds a missing return description. See #32246. git-svn-id: https://develop.svn.wordpress.org/trunk@33318 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/category-template.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/category-template.php b/src/wp-includes/category-template.php index 9f4e1ac74a..d29ae479ec 100644 --- a/src/wp-includes/category-template.php +++ b/src/wp-includes/category-template.php @@ -65,10 +65,15 @@ function get_category_parents( $id, $link = false, $separator = '/', $nicename = /** * Retrieve post categories. * + * This tag may be used outside The Loop by passing a post id as the parameter. + * + * Note: This function only returns results from the default "category" taxonomy. + * For custom taxonomies use get_the_terms(). + * * @since 0.71 * * @param int $id Optional, default to current post ID. The post ID. - * @return array + * @return array Array of objects, one for each category assigned to the post. */ function get_the_category( $id = false ) { $categories = get_the_terms( $id, 'category' );