更新缓存中的分类术语。
原型
update_term_cache( array $terms, string $taxonomy = '' )
参数
$terms
(array)
(Required)
要更改的术语对象列表。
$taxonomy
(string)
(Optional)
在缓存中更新此分类的术语。
源文件
路径:wp-includes/taxonomy.php
<?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' );
}
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/update_term_cache/