清理分类的缓存。
原型
clean_taxonomy_cache( string $taxonomy )
参数
$taxonomy
(string)
(Required)
分类标本。
源文件
路径:wp-includes/taxonomy.php
<?php
...
function clean_taxonomy_cache( $taxonomy ) {
wp_cache_delete( 'all_ids', $taxonomy );
wp_cache_delete( 'get', $taxonomy );
// Regenerate cached hierarchy.
delete_option( "{$taxonomy}_children" );
_get_term_hierarchy( $taxonomy );
/**
* Fires after a taxonomy's caches have been cleaned.
*
* @since 4.9.0
*
* @param string $taxonomy Taxonomy slug.
*/
do_action( 'clean_taxonomy_cache', $taxonomy );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/clean_taxonomy_cache/