Docs: Use a hash notation for the `$args` parameter to describe the `fields` argument in the DocBlock for `wp_get_post_terms()`.

Also, the `$taxonomy` parameter can accept either a string or array of taxonomies.

Props ohryan for the initial tip.
See #41017.


git-svn-id: https://develop.svn.wordpress.org/trunk@41034 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Drew Jaynes 2017-07-12 22:20:16 +00:00
parent 994ef530d1
commit f628aaacda
1 changed files with 12 additions and 12 deletions

View File

@ -2838,21 +2838,21 @@ function wp_get_post_tags( $post_id = 0, $args = array() ) {
} }
/** /**
* Retrieve the terms for a post. * Retrieves the terms for a post.
*
* There is only one default for this function, called 'fields' and by default
* is set to 'all'. There are other defaults that can be overridden in
* wp_get_object_terms().
* *
* @since 2.8.0 * @since 2.8.0
* *
* @param int $post_id Optional. The Post ID. Does not default to the ID of the * @param int $post_id Optional. The Post ID. Does not default to the ID of the
* global $post. Default 0. * global $post. Default 0.
* @param string $taxonomy Optional. The taxonomy for which to retrieve terms. Default 'post_tag'. * @param string|array $taxonomy Optional. The taxonomy slug or array of slugs for which
* @param array $args Optional. Term query parameters. Default empty array. * to retrieve terms. Default 'post_tag'.
* See WP_Term_Query::__construct() for supported arguments. * @param array $args {
* @return array|WP_Error Array of WP_Term objects on success or empty array if no terms were found. * Optional. Term query parameters. See WP_Term_Query::__construct() for supported arguments.
* WP_Error object if `$taxonomy` doesn't exist. *
* @type string $fields Term fields to retrieve. Default 'all'.
* }
* @return array|WP_Error Array of WP_Term objects on success or empty array if no terms were found.
* WP_Error object if `$taxonomy` doesn't exist.
*/ */
function wp_get_post_terms( $post_id = 0, $taxonomy = 'post_tag', $args = array() ) { function wp_get_post_terms( $post_id = 0, $taxonomy = 'post_tag', $args = array() ) {
$post_id = (int) $post_id; $post_id = (int) $post_id;