diff --git a/src/wp-includes/class-wp-term-query.php b/src/wp-includes/class-wp-term-query.php
index e27b686..829069b 100644
a
|
b
|
class WP_Term_Query { |
288 | 288 | return $this->get_terms(); |
289 | 289 | } |
290 | 290 | |
| 291 | /** |
| 292 | * Maps the term id array to real term objects. |
| 293 | * |
| 294 | * @param array $terms |
| 295 | * |
| 296 | * @return array |
| 297 | */ |
| 298 | private function map_terms( array $terms ) { |
| 299 | $terms = array_map( 'get_term', $terms ); |
| 300 | |
| 301 | // TODO change to anonymous functions if WordPress drops 5.2 support |
| 302 | return array_filter($terms, create_function('$value', 'return $value !== null;')); |
| 303 | } |
| 304 | |
291 | 305 | /** |
292 | 306 | * Get terms, based on query_vars. |
293 | 307 | * |
… |
… |
class WP_Term_Query { |
677 | 691 | $cache = wp_cache_get( $cache_key, 'terms' ); |
678 | 692 | if ( false !== $cache ) { |
679 | 693 | if ( 'all' === $_fields ) { |
680 | | $cache = array_map( 'get_term', $cache ); |
| 694 | $cache = $this->map_terms( $cache ); |
681 | 695 | } |
682 | 696 | |
683 | 697 | $this->terms = $cache; |
… |
… |
class WP_Term_Query { |
809 | 823 | wp_cache_add( $cache_key, $terms, 'terms', DAY_IN_SECONDS ); |
810 | 824 | |
811 | 825 | if ( 'all' === $_fields || 'all_with_object_id' === $_fields ) { |
812 | | $terms = array_map( 'get_term', $terms ); |
| 826 | $terms = $this->map_terms( $terms ); |
813 | 827 | } |
814 | 828 | |
815 | 829 | $this->terms = $terms; |