Inventory_Presser_Taxonomy_Overlapper::check_for_remaining_term_relationship( int $object_id, string $taxonomy )
A meta value was just deleted after a term relationship was deleted.
On This Page
Description Description
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
-
(int) (Required) The vehicle post ID being updated.
- $taxonomy
-
(string) (Required) The taxonomy slug.
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 = self::overlapping_meta_keys_flipped(); $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