函数原型
clean_taxonomy_cache( string $taxonomy )
函数描述
Cleans the caches for a taxonomy.
是否弃用
未弃用
函数参数
-
$taxonomy
string
Required - Taxonomy slug.
函数返回值
无
函数位置
File: wp-includes/taxonomy.php.
函数源码
function clean_taxonomy_cache( $taxonomy ) {
wp_cache_delete( 'all_ids', $taxonomy );
wp_cache_delete( 'get', $taxonomy );
wp_cache_delete( 'last_changed', 'terms' );
// 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 );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 4.9.0 | Introduced. |

