WordPress at Your Fingertips
function is not described


LookupDataStore::on_product_deleted() public WC 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.

{} It's a method of the class: LookupDataStore{}

No Hooks.


null. Nothing.


$LookupDataStore = new LookupDataStore();
$LookupDataStore->on_product_deleted( $product );
$product(int|\WC_Product) (required)
Product object or product id.

Code of LookupDataStore::on_product_deleted() WC 5.9.0

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

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