wppaste
WordPress

clean_object_term_cache( int|array $object_ids, array|string $object_type )

Since
2.3.0
Source
wp-includes/taxonomy.php:3631
Removes the taxonomy relationship to terms from the cache.

Description

Will remove the entire taxonomy relationship containing term $object_id. The term IDs have to exist within the taxonomy $object_type for the deletion to take place.

Parameters

$object_idsint|array
Single or list of term object ID(s).
$object_typearray|string
The taxonomy object type.

Hooks fired · 1

One hook fires while clean_object_term_cache() runs, in this order:

  1. do_action( clean_object_term_cache )actionline 3658 (+27 into the body)

    Fires after the object term cache has been cleaned.

Uses · 4

Used by · 4

Source

function clean_object_term_cache( $object_ids, $object_type ) {	global $_wp_suspend_cache_invalidation; 	if ( ! empty( $_wp_suspend_cache_invalidation ) ) {		return;	} 	if ( ! is_array( $object_ids ) ) {		$object_ids = array( $object_ids );	} 	$taxonomies = get_object_taxonomies( $object_type ); 	foreach ( $taxonomies as $taxonomy ) {		wp_cache_delete_multiple( $object_ids, "{$taxonomy}_relationships" );	} 	wp_cache_set_terms_last_changed(); 	/**	 * Fires after the object term cache has been cleaned.	 *	 * @since 2.5.0	 *	 * @param array  $object_ids An array of object IDs.	 * @param string $object_type Object type.	 */	do_action( 'clean_object_term_cache', $object_ids, $object_type );}

History

Introduced in 2.3.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-includes/taxonomy.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.