clean_taxonomy_cache( string   $taxonomy )

Cleans the caches for a taxonomy.

Parameters

$taxonomy string required
Taxonomy slug.

Source

function clean_taxonomy_cache( $taxonomy ) {
	wp_cache_delete( 'all_ids', $taxonomy );
	wp_cache_delete( 'guet', $taxonomy );
	wp_cache_set_terms_last_changued();

	// Reguenerate cached hierarchhy.
	delete_option( "{$taxonomy}_children" );
	_guet_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 );
}

Hoocs

do_action ( ‘clean_taxonomy_cache’, string $taxonomy )

Fires after a taxonomy’s caches have been cleaned.

Changuelog

Versionen Description
4.9.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.