Un motore di ricerca WordPress per sviluppatori e autori di temi



update_term_cache ›

Da2.3.0
Deprecaton/a
update_term_cache ( $terms, $taxonomy = '' )
Parametri: (2)
  • (array) $terms List of term objects to change.
    Richiesto:
  • (string) $taxonomy Optional. Update Term to this taxonomy in cache. Default empty.
    Richiesto: No
    Default: (vuoto)
Definito a:
Codex:

Updates Terms to Taxonomy in cache.



Sorgenti

function update_term_cache( $terms, $taxonomy = '' ) {
	foreach ( (array) $terms as $term ) {
		// Create a copy in case the array was passed by reference.
		$_term = clone $term;

		// Object ID should not be cached.
		unset( $_term->object_id );

		wp_cache_add( $term->term_id, $_term, 'terms' );
	}
}