clean_taxonomy_cache() – Cleans the caches for a taxonomy.

You appear to be a bot. Output may be restricted

Description

Cleans the caches for a taxonomy.

Usage

clean_taxonomy_cache( $taxonomy );

Parameters

$taxonomy
( string ) required – Taxonomy slug.

Returns

void

Source

File name: wordpress/wp-includes/taxonomy.php


Lines:

1 to 20 of 20
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 );
}
 

 View on GitHub View on Trac