wc_clear_term_product_ids()WC 1.0

When a post is updated and terms recounted (called by _update_post_term_count), clear the ids.

No Hooks.


null. Nothing.


wc_clear_term_product_ids( $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids );
$object_id(int) (required)
Object ID.
$terms(array) (required)
An array of object terms.
$tt_ids(array) (required)
An array of term taxonomy IDs.
$taxonomy(string) (required)
Taxonomy slug.
$append(true|false) (required)
Whether to append new terms to the old terms.
$old_tt_ids(array) (required)
Old array of term taxonomy IDs.

Code of wc_clear_term_product_ids() WC 6.7.0

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' );