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.

Built from https://develop.svn.wordpress.org/trunk@33318


git-svn-id: http://core.svn.wordpress.org/trunk@33290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Drew Jaynes 2015-07-17 22:58:25 +00:00
parent 909dde9ce5
commit 0729c70e03
2 changed files with 7 additions and 2 deletions

View File

@ -65,10 +65,15 @@ function get_category_parents( $id, $link = false, $separator = '/', $nicename =
/** /**
* Retrieve post categories. * 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 * @since 0.71
* *
* @param int $id Optional, default to current post ID. The post ID. * @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 ) { function get_the_category( $id = false ) {
$categories = get_the_terms( $id, 'category' ); $categories = get_the_terms( $id, 'category' );

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.3-beta3-33317'; $wp_version = '4.3-beta3-33318';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.