clean_term_cache
Action HookDescription
Fires once after each taxonomy's term cache has been cleaned.Hook Information
File Location |
wp-includes/taxonomy.php
View on GitHub
|
Hook Type | Action |
Line Number | 3710 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$ids
|
An array of term IDs. |
string
|
$taxonomy
|
Taxonomy slug. |
bool
|
$clean_taxonomy
|
Whether or not to clean taxonomy-wide caches |
Usage Examples
Basic Usage
<?php
// Hook into clean_term_cache
add_action('clean_term_cache', 'my_custom_function', 10, 3);
function my_custom_function($ids, $taxonomy, $clean_taxonomy) {
// Your custom code here
}
Source Code Context
wp-includes/taxonomy.php:3710
- How this hook is used in WordPress core
<?php
3705 *
3706 * @param array $ids An array of term IDs.
3707 * @param string $taxonomy Taxonomy slug.
3708 * @param bool $clean_taxonomy Whether or not to clean taxonomy-wide caches
3709 */
3710 do_action( 'clean_term_cache', $ids, $taxonomy, $clean_taxonomy );
3711 }
3712
3713 wp_cache_set_terms_last_changed();
3714 }
3715
PHP Documentation
<?php
/**
* Fires once after each taxonomy's term cache has been cleaned.
*
* @since 2.5.0
* @since 4.5.0 Added the `$clean_taxonomy` parameter.
*
* @param array $ids An array of term IDs.
* @param string $taxonomy Taxonomy slug.
* @param bool $clean_taxonomy Whether or not to clean taxonomy-wide caches
*/
Quick Info
- Hook Type: Action
- Parameters: 3
- File: wp-includes/taxonomy.php
Related Hooks
Related hooks will be displayed here in future updates.