wc_clear_term_product_ids()
When a post is updated and terms recounted (called by _update_post_term_count), clear the ids.
Хуков нет.
Возвращает
null. Ничего (null).
Использование
wc_clear_term_product_ids( $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids );
- $object_id(int) (обязательный)
- Object ID.
- $terms(массив) (обязательный)
- An array of object terms.
- $tt_ids(массив) (обязательный)
- An array of term taxonomy IDs.
- $taxonomy(строка) (обязательный)
- Taxonomy slug.
- $append(true|false) (обязательный)
- Whether to append new terms to the old terms.
- $old_tt_ids(массив) (обязательный)
- Old array of term taxonomy IDs.
Код wc_clear_term_product_ids() wc clear term product ids WC 10.6.2
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' );
}
}