Make WordPress Core


Ignore:
Timestamp:
04/19/2017 11:07:18 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve @param and @return entries for wp_get_post_categories(), wp_get_post_tags(), and wp_get_post_terms().

Props philipjohn, theMikeD.
Fixes #40481.

File:
1 edited

Legend:

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

    r40054 r40483  
    28012801 * @param int   $post_id Optional. The Post ID. Does not default to the ID of the
    28022802 *                       global $post. Default 0.
    2803  * @param array $args    Optional. Category arguments. See wp_get_object_terms(). Default empty.
    2804  * @return array List of categories. If the `$fields` argument passed via `$args` is 'all' or
    2805  *               'all_with_object_id', an array of WP_Term objects will be returned. If `$fields`
    2806  *               is 'ids', an array of category ids. If `$fields` is 'names', an array of category names.
     2803 * @param array $args    Optional. Category query parameters. Default empty array.
     2804 *                       See WP_Term_Query::__construct() for supported arguments.
     2805 * @return array|WP_Error List of categories. If the `$fields` argument passed via `$args` is 'all' or
     2806 *                        'all_with_object_id', an array of WP_Term objects will be returned. If `$fields`
     2807 *                        is 'ids', an array of category ids. If `$fields` is 'names', an array of category names.
     2808 *                        WP_Error object if 'category' taxonomy doesn't exist.
    28072809 */
    28082810function wp_get_post_categories( $post_id = 0, $args = array() ) {
     
    28272829 * @param int   $post_id Optional. The Post ID. Does not default to the ID of the
    28282830 *                       global $post. Default 0.
    2829  * @param array $args Optional. Overwrite the defaults
    2830  * @return array List of post tags.
     2831 * @param array $args    Optional. Tag query parameters. Default empty array.
     2832 *                       See WP_Term_Query::__construct() for supported arguments.
     2833 * @return array|WP_Error Array of WP_Term objects on success or empty array if no tags were found.
     2834 *                        WP_Error object if 'post_tag' taxonomy doesn't exist.
    28312835 */
    28322836function wp_get_post_tags( $post_id = 0, $args = array() ) {
     
    28462850 *                         global $post. Default 0.
    28472851 * @param string $taxonomy Optional. The taxonomy for which to retrieve terms. Default 'post_tag'.
    2848  * @param array  $args     Optional. wp_get_object_terms() arguments. Default empty array.
    2849  * @return array|WP_Error  List of post terms or empty array if no terms were found. WP_Error object
    2850  *                         if `$taxonomy` doesn't exist.
     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.
    28512856 */
    28522857function wp_get_post_terms( $post_id = 0, $taxonomy = 'post_tag', $args = array() ) {
Note: See TracChangeset for help on using the changeset viewer.