Automattic\WooCommerce\Internal\ProductAttributesLookup
LookupDataStore::on_product_deleted()
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() LookupDataStore::on product deleted WC 7.7.2
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 ); }