clean_taxonomy_cache

The timeline below displays how wordpress function clean_taxonomy_cache has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.3

/**
 * Cleans the caches for a taxonomy.
 *
 * @since 4.9.0
 *
 * @param string $taxonomy Taxonomy slug.
 */
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.
    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);
}

WordPress Version: 6.1

/**
 * Cleans the caches for a taxonomy.
 *
 * @since 4.9.0
 *
 * @param string $taxonomy Taxonomy slug.
 */
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);
}

WordPress Version: 4.9

/**
 * Clean the caches for a taxonomy.
 *
 * @since 4.9.0
 *
 * @param string $taxonomy Taxonomy slug.
 */
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);
}