On this page
update_termmeta_cache( array $term_ids ): array|false
Updates metadata cache for list of term IDs.
Description
Performs SQL query to retrieve all metadata for the terms matching $term_ids and stores them in the cache.
Subsequent calls to get_term_meta() will not need to query the database.
Parameters
$term_idsarray Required-
List of term IDs.
Return
array|false An array of metadata on success, false if there is nothing to update.
Source
File: wp-includes/taxonomy.php. View all references
function update_termmeta_cache( $term_ids ) {
return update_meta_cache( 'term', $term_ids );
}
Related
Uses
| Uses | Description |
|---|---|
| update_meta_cache() wp-includes/meta.php | Updates the metadata cache for the specified objects. |
Used By
| Used By | Description |
|---|---|
| WP_Term_Query::get_terms() wp-includes/class-wp-term-query.php | Retrieves the query results. |
| _prime_term_caches() wp-includes/taxonomy.php | Adds any terms from the given IDs to the cache that do not already exist in cache. |
| WP_Metadata_Lazyloader::lazyload_term_meta() wp-includes/class-wp-metadata-lazyloader.php | Lazy-loads term meta for queued terms. |
Changelog
| Version | Description |
|---|---|
| 4.4.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/update_termmeta_cache