Automattic\WooCommerce\Internal\Caches

ProductVersionStringInvalidator::handle_edited_termpublicWC 10.5.0

Handle the edited_term hook.

Method of the class: ProductVersionStringInvalidator{}

No Hooks.

Returns

null. Nothing (null).

Usage

$ProductVersionStringInvalidator = new ProductVersionStringInvalidator();
$ProductVersionStringInvalidator->handle_edited_term( $term_id, $tt_id, $taxonomy ): void;
$term_id(int) (required)
The term ID.
$tt_id(int) (required)
The term taxonomy ID.
$taxonomy(string) (required)
The taxonomy slug.

Changelog

Since 10.5.0 Introduced.

ProductVersionStringInvalidator::handle_edited_term() code WC 10.7.0

public function handle_edited_term( $term_id, $tt_id, $taxonomy ): void {
	if ( ! is_string( $taxonomy ) ) {
		return;
	}

	// Only handle product attribute taxonomies.
	if ( 0 !== strpos( $taxonomy, 'pa_' ) ) {
		return;
	}

	$this->invalidate_products_with_term( (int) $tt_id );
}