Make WordPress Core

Changeset 54441


Ignore:
Timestamp:
10/10/2022 12:28:20 PM (17 months ago)
Author:
audrasjb
Message:

Docs: Improve wp_get_object_terms() return type.

Props dd32, audrasjb, desrosj, mukesh27.
Fixes #56327.
See #55646.

File:
1 edited

Legend:

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

    r54266 r54441  
    21812181 * @param string|string[] $taxonomies The taxonomy names to retrieve terms from.
    21822182 * @param array|string    $args       See WP_Term_Query::__construct() for supported arguments.
    2183  * @return WP_Term[]|WP_Error Array of terms or empty array if no terms found.
    2184  *                            WP_Error if any of the taxonomies don't exist.
     2183 * @return WP_Term[]|int[]|string[]|string|WP_Error Array of terms, a count thereof as a numeric string,
     2184 *                                                  or WP_Error if any of the taxonomies do not exist.
     2185 *                                                  See WP_Term_Query::get_terms() for more information.
    21852186 */
    21862187function wp_get_object_terms( $object_ids, $taxonomies, $args = array() ) {
     
    22582259     * @since 4.2.0
    22592260     *
    2260      * @param WP_Term[] $terms      Array of terms for the given object or objects.
    2261      * @param int[]     $object_ids Array of object IDs for which terms were retrieved.
    2262      * @param string[]  $taxonomies Array of taxonomy names from which terms were retrieved.
    2263      * @param array     $args       Array of arguments for retrieving terms for the given
    2264      *                              object(s). See wp_get_object_terms() for details.
     2261     * @param WP_Term[]|int[]|string[]|string $terms      Array of terms or a count thereof as a numeric string.
     2262     * @param int[]                           $object_ids Array of object IDs for which terms were retrieved.
     2263     * @param string[]                        $taxonomies Array of taxonomy names from which terms were retrieved.
     2264     * @param array                           $args       Array of arguments for retrieving terms for the given
     2265     *                                                    object(s). See wp_get_object_terms() for details.
    22652266     */
    22662267    $terms = apply_filters( 'get_object_terms', $terms, $object_ids, $taxonomies, $args );
     
    22772278     * @since 2.8.0
    22782279     *
    2279      * @param WP_Term[] $terms      Array of terms for the given object or objects.
    2280      * @param string    $object_ids Comma separated list of object IDs for which terms were retrieved.
    2281      * @param string    $taxonomies SQL fragment of taxonomy names from which terms were retrieved.
    2282      * @param array     $args       Array of arguments for retrieving terms for the given
    2283      *                              object(s). See wp_get_object_terms() for details.
     2280     * @param WP_Term[]|int[]|string[]|string $terms      Array of terms or a count thereof as a numeric string.
     2281     * @param string                          $object_ids Comma separated list of object IDs for which terms were retrieved.
     2282     * @param string                          $taxonomies SQL fragment of taxonomy names from which terms were retrieved.
     2283     * @param array                           $args       Array of arguments for retrieving terms for the given
     2284     *                                                    object(s). See wp_get_object_terms() for details.
    22842285     */
    22852286    return apply_filters( 'wp_get_object_terms', $terms, $object_ids, $taxonomies, $args );
Note: See TracChangeset for help on using the changeset viewer.