wc_clear_term_product_ids( int $object_id, array $terms, array $tt_ids, string $taxonomy, bool $append, array $old_tt_ids )
When a post is updated and terms recounted (called by _update_post_term_count), clear the ids.
Description Description
Parameters Parameters
- $object_id
-
(Required) Object ID.
- $terms
-
(Required) An array of object terms.
- $tt_ids
-
(Required) An array of term taxonomy IDs.
- $taxonomy
-
(Required) Taxonomy slug.
- $append
-
(Required) Whether to append new terms to the old terms.
- $old_tt_ids
-
(Required) Old array of term taxonomy IDs.
Source Source
File: includes/wc-term-functions.php
function wc_clear_term_product_ids( $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids ) { foreach ( $old_tt_ids as $term_id ) { delete_term_meta( $term_id, 'product_ids' ); } foreach ( $tt_ids as $term_id ) { delete_term_meta( $term_id, 'product_ids' ); } }