WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/10/2015 02:12:40 AM (6 years ago)
Author:
boonebgorges
Message:

Return WP_Term objects from get_terms().

Props boonebgorges, flixos90, DrewAPicture.
See #14162.

File:
1 edited

Legend:

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

    r34997 r34998  
    992992 * @since 4.2.0 Introduced 'name' and 'childless' parameters.
    993993 * @since 4.4.0 Introduced the ability to pass 'term_id' as an alias of 'id' for the `orderby` parameter.
    994  *              Introduced the 'meta_query' and 'update_term_meta_cache' parameters.
     994 *              Introduced the 'meta_query' and 'update_term_meta_cache' parameters. Converted to return
     995 *              a list of WP_Term objects.
    995996 *
    996997 * @global wpdb  $wpdb WordPress database abstraction object.
     
    10531054 *                                                See `WP_Meta_Query`. Default empty.
    10541055 * }
    1055  * @return array|int|WP_Error List of Term Objects and their children. Will return WP_Error, if any of $taxonomies
    1056  *                        do not exist.
     1056 * @return array|int|WP_Error List of WP_Term instances and their children. Will return WP_Error, if any of $taxonomies
     1057 *                            do not exist.
    10571058 */
    10581059function get_terms( $taxonomies, $args = '' ) {
     
    14941495            $_terms[ $term->term_id ] = $term->slug;
    14951496        }
     1497    } else {
     1498        $_terms = array_map( 'get_term', $terms );
    14961499    }
    14971500
Note: See TracChangeset for help on using the changeset viewer.