wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



clean_taxonomy_cache › WordPress Function

Depuis4.9.0
Dépréciéen/a
clean_taxonomy_cache ( $taxonomy )
Paramètres:
  • (string) $taxonomy Taxonomy slug.
    Requis: Oui
Défini(e) dans:
Codex:

Cleans the caches for a taxonomy.



Source

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 );
}