Make WordPress Core

Changeset 59704


Ignore:
Timestamp:
01/24/2025 11:26:18 PM (5 months ago)
Author:
audrasjb
Message:

Docs: Improve @return docblock section for get_category().

This changeset adds more details on the WP_Term returned by get_category() as it contains additional backwards compatible aliases for the era before WP 4.4 and 2.3.

Props apermo, audrasjb.
Fixes #62842.
See #62281.

File:
1 edited

Legend:

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

    r56434 r59704  
    8686 *                             respectively. Default OBJECT.
    8787 * @param string     $filter   Optional. How to sanitize category fields. Default 'raw'.
    88  * @return object|array|WP_Error|null Category data in type defined by $output parameter.
    89  *                                    WP_Error if $category is empty, null if it does not exist.
     88 * @return WP_Term|array|WP_Error|null Category data in type defined by $output parameter.
     89 *                                     Returns a WP_Term object with backwards compatible property aliases filled in.
     90 *                                     WP_Error if $category is empty, null if it does not exist.
    9091 */
    9192function get_category( $category, $output = OBJECT, $filter = 'raw' ) {
Note: See TracChangeset for help on using the changeset viewer.