update_term_cache() – Updates terms in cache.

You appear to be a bot. Output may be restricted

Description

Updates terms in cache.

Usage

update_term_cache( $terms, $taxonomy );

Parameters

$terms
( WP_Term[] ) required – Array of term objects to change.
$taxonomy
( string ) optional – Not used.

Returns

void

Source

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


Lines:

1 to 14 of 14
function update_term_cache( $terms, $taxonomy = '' ) {
  $data = array();
  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 );

    $data[ $term->term_id ] = $_term;
  }
  wp_cache_add_multiple( $data, 'terms' );
}
 

 View on GitHub View on Trac