function clean_object_term_cache($object_ids, $object_type) {}

Removes the taxonomy relationship to terms from the cache.
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.


  • int|array $object_ids: Single or list of term object ID(s)
  • array|string $object_type: The taxonomy object type

Source code

function clean_object_term_cache($object_ids, $object_type) {

	if ( !is_array($object_ids) )

		$object_ids = array($object_ids);

	foreach ( $object_ids as $id )

		foreach ( get_object_taxonomies($object_type) as $taxonomy )

			wp_cache_delete($id, "{$taxonomy}_relationships");


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: Logo

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

Facebook photo

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

Connecting to %s

%d bloggers like this: