Automattic\WooCommerce\Internal\ProductAttributesLookup

LookupDataStore::on_product_deleted()publicWC 1.0

Delete the lookup table contents related to a given product or variation, if it's a variable product it deletes the information for variations too. This must be invoked after a product or a variation is trashed or deleted.

{} Это метод класса: LookupDataStore{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$LookupDataStore = new LookupDataStore();
$LookupDataStore->on_product_deleted( $product );
$product(int|\WC_Product) (обязательный)
Product object or product id.

Код LookupDataStore::on_product_deleted() WC 6.9.4

public function on_product_deleted( $product ) {
	if ( ! $this->check_lookup_table_exists() ) {
		return;
	}

	if ( is_a( $product, \WC_Product::class ) ) {
		$product_id = $product->get_id();
	} else {
		$product_id = $product;
	}

	$this->maybe_schedule_update( $product_id, self::ACTION_DELETE );
}