clean_taxonomy_cache()
Cleans the caches for a taxonomy.
Хуки из функции
Возвращает
null. Ничего (null).
Использование
clean_taxonomy_cache( $taxonomy );
- $taxonomy(строка) (обязательный)
- Taxonomy slug.
Список изменений
| С версии 4.9.0 | Введена. |
Код clean_taxonomy_cache() clean taxonomy cache WP 6.9.1
function clean_taxonomy_cache( $taxonomy ) {
wp_cache_delete( 'all_ids', $taxonomy );
wp_cache_delete( 'get', $taxonomy );
wp_cache_set_terms_last_changed();
// Regenerate cached hierarchy.
if ( is_taxonomy_hierarchical( $taxonomy ) ) {
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 );
}