Changeset 38776 for trunk/src/wp-includes/taxonomy.php
- Timestamp:
- 10/11/2016 01:55:58 AM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/taxonomy.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/taxonomy.php
r38747 r38776 3011 3011 * 3012 3012 * @since 2.3.0 3013 * @since 4.6.2 Returns a WP_Error object if get_term() returns an error for 3014 * any of the matched terms. 3013 3015 * 3014 3016 * @param int $id Term object ID. 3015 3017 * @param string $taxonomy Taxonomy name. 3016 * @return bool|array Array of `WP_Term` objects, if cached False if cache is empty for `$taxonomy` and `$id`. 3018 * @return bool|array|WP_Error Array of `WP_Term` objects, if cached. 3019 * False if cache is empty for `$taxonomy` and `$id`. 3020 * WP_Error if get_term() returns an error object for any term. 3017 3021 */ 3018 3022 function get_object_term_cache( $id, $taxonomy ) { … … 3039 3043 $terms = array(); 3040 3044 foreach ( $term_ids as $term_id ) { 3041 $terms[] = wp_cache_get( $term_id, 'terms' ); 3042 } 3043 3044 return array_map( 'get_term', $terms ); 3045 $term = get_term( $term_id ); 3046 if ( is_wp_error( $term ) ) { 3047 return $term; 3048 } 3049 3050 $terms[] = $term; 3051 } 3052 3053 return $terms; 3045 3054 } 3046 3055
Note: See TracChangeset
for help on using the changeset viewer.