Uses
Uses | Description |
---|---|
wp-includes/cache.php: wp_cache_add() | Adds data to the cache, if the cache key doesn’t already exist. |
Updates Terms to Taxonomy in cache.
(WP_Term[]) (Required) Array of term objects to change.
(string) (Optional) Not used.
Default value: ''
File: wp-includes/taxonomy.php
function update_term_cache( $terms, $taxonomy = '' ) { foreach ( (array) $terms as $term ) { // Create a copy in case the array was passed by reference. $_term = clone $term; // Object ID should not be cached. unset( $_term->object_id ); wp_cache_add( $term->term_id, $_term, 'terms' ); } }
Version | Description |
---|---|
2.3.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/update_term_cache