update_term_cache

Definition:
function update_term_cache($terms, $taxonomy = '') {}

Updates Terms to Taxonomy in cache.

Parameters

  • array $terms: List of Term objects to change
  • string $taxonomy: Optional. Update Term to this taxonomy in cache

Source code

function update_term_cache($terms, $taxonomy = '') {

	foreach ( (array) $terms as $term ) {

		$term_taxonomy = $taxonomy;

		if ( empty($term_taxonomy) )

			$term_taxonomy = $term->taxonomy;



		wp_cache_add($term->term_id, $term, $term_taxonomy);

	}

}

3207

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: