Make WordPress Core

Changeset 41034


Ignore:
Timestamp:
07/12/2017 10:20:16 PM (6 years ago)
Author:
DrewAPicture
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r40925 r41034  
    28392839
    28402840/**
    2841  * Retrieve the terms for a post.
    2842  *
    2843  * There is only one default for this function, called 'fields' and by default
    2844  * is set to 'all'. There are other defaults that can be overridden in
    2845  * wp_get_object_terms().
     2841 * Retrieves the terms for a post.
    28462842 *
    28472843 * @since 2.8.0
    28482844 *
    2849  * @param int    $post_id  Optional. The Post ID. Does not default to the ID of the
    2850  *                         global $post. Default 0.
    2851  * @param string $taxonomy Optional. The taxonomy for which to retrieve terms. Default 'post_tag'.
    2852  * @param array  $args     Optional. Term query parameters. Default empty array.
    2853  *                         See WP_Term_Query::__construct() for supported arguments.
    2854  * @return array|WP_Error  Array of WP_Term objects on success or empty array if no terms were found.
    2855  *                         WP_Error object if `$taxonomy` doesn't exist.
     2845 * @param int          $post_id  Optional. The Post ID. Does not default to the ID of the
     2846 *                               global $post. Default 0.
     2847 * @param string|array $taxonomy Optional. The taxonomy slug or array of slugs for which
     2848 *                               to retrieve terms. Default 'post_tag'.
     2849 * @param array        $args     {
     2850 *     Optional. Term query parameters. See WP_Term_Query::__construct() for supported arguments.
     2851 *
     2852 *     @type string $fields Term fields to retrieve. Default 'all'.
     2853 * }
     2854 * @return array|WP_Error Array of WP_Term objects on success or empty array if no terms were found.
     2855 *                        WP_Error object if `$taxonomy` doesn't exist.
    28562856 */
    28572857function wp_get_post_terms( $post_id = 0, $taxonomy = 'post_tag', $args = array() ) {
Note: See TracChangeset for help on using the changeset viewer.