LookupDataStore::delete_data_for()privateWC 1.0

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

Method of the class: LookupDataStore{}

No Hooks.


null. Nothing (null).


// 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.

LookupDataStore::delete_data_for() code WC 8.9.0

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

	// phpcs:disable WordPress.DB.PreparedSQL.NotPrepared
			'DELETE FROM ' . $this->lookup_table_name . ' WHERE product_id = %d OR product_or_parent_id = %d',
	// phpcs:enable WordPress.DB.PreparedSQL.NotPrepared