update_term_cache

Advertisement

Summery Summery

Updates Terms to Taxonomy in cache.

Syntax Syntax

update_term_cache( WP_Term[] $terms, string $taxonomy = '' )

Parameters Parameters

$terms

(WP_Term[]) (Required) Array of term objects to change.

$taxonomy

(string) (Optional) Not used.

Default value: ''

Source Source

File: wp-includes/taxonomy.php

	if ( false === $_term_ids ) {
		return false;
	}

	// Backward compatibility for if a plugin is putting objects into the cache, rather than IDs.
	$term_ids = array();
	foreach ( $_term_ids as $term_id ) {
		if ( is_numeric( $term_id ) ) {
			$term_ids[] = intval( $term_id );
		} elseif ( isset( $term_id->term_id ) ) {
			$term_ids[] = intval( $term_id->term_id );

Advertisement

Changelog Changelog

Changelog
Version Description
2.3.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.