Inventory_Presser_Taxonomy_Overlapper::check_for_remaining_term_relationship( mixed $object_id, mixed $taxonomy, mixed $term )
check_for_remaining_term_relationship
On This Page
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.
Parameters Parameters
- $object_id
-
(mixed) (Required)
- $taxonomy
-
(mixed) (Required)
- $term
-
(mixed) (Required)
Return Return
(void)
Source Source
File: includes/class-taxonomy-overlapper.php
*/ public function check_for_remaining_term_relationship( $object_id, $taxonomy ) { $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();
Expand full source codeCollapse full source codeView on Github