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
This commit is contained in:
Drew Jaynes
2015-07-17 22:57:20 +00:00
parent d755a8d7f5
commit c1e158cf87

View File

@@ -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' );