Inventory_Presser_Taxonomy_Overlapper::check_for_remaining_term_relationship( mixed $object_id, mixed $taxonomy, mixed $term )

check_for_remaining_term_relationship

Description Description

A meta value was just deleted after a term relationship was deleted.<br>Check for another term relationship in the same taxonomy. A user could have marked a vehicle as both an Acura and Audi by mistake, and removed one. We want to make sure the meta value contains the remaining term name.


Top ↑

Parameters Parameters

$object_id

(mixed) (Required)

$taxonomy

(mixed) (Required)

$term

(mixed) (Required)


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/class-taxonomy-overlapper.php

	public function check_for_remaining_term_relationship( $object_id, $taxonomy, $term ) {
		$terms = wp_get_object_terms( $object_id, $taxonomy );
		if ( empty( $terms ) ) {
			return;
		}

		$taxonomies_and_keys = array_flip( $this->overlapping_meta_keys() );

		$this->hooks_remove_meta();
		update_post_meta( $object_id, apply_filters( 'invp_prefix_meta_key', $taxonomies_and_keys[ $taxonomy ] ), $terms[0]->name );
		$this->hooks_add_meta();
	}