WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Internal\ProductAttributesLookup

LookupDataStore::delete_data_for() private WC 1.0

Delete all the lookup table entries for a given product, if it's a variable product information for variations is deleted too.

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

No Hooks.

Return

null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->delete_data_for( $product_id );
$product_id(int) (required)
Simple product id, or main/parent product id for variable products.

Code of LookupDataStore::delete_data_for() WC 5.9.0

private function delete_data_for( int $product_id ) {
	global $wpdb;

	// phpcs:disable WordPress.DB.PreparedSQL.NotPrepared
	$wpdb->query(
		$wpdb->prepare(
			'DELETE FROM ' . $this->lookup_table_name . ' WHERE product_id = %d OR product_or_parent_id = %d',
			$product_id,
			$product_id
		)
	);
	// phpcs:enable WordPress.DB.PreparedSQL.NotPrepared
}