clean_taxonomy_cache()
最后更新于:2021-11-25 20:35:07
clean_taxonomy_cache( string$taxonomy)Clean the caches for a taxonomy.
参数
- $taxonomy
-
(string) (Required) Taxonomy slug.
源文件
文件: gc-includes/taxonomy.php
function clean_taxonomy_cache( $taxonomy ) {
gc_cache_delete( 'all_ids', $taxonomy );
gc_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 );
}