Automattic\WooCommerce\Internal\ProductAttributesLookup
DataRegenerator::delete_all_attributes_lookup_data
Delete all the existing data related to the lookup table, optionally including the table itself.
Method of the class: DataRegenerator{}
No Hooks.
Returns
null. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->delete_all_attributes_lookup_data( $truncate_table );
- $truncate_table(true|false) (required)
- True to truncate the lookup table too.
DataRegenerator::delete_all_attributes_lookup_data() DataRegenerator::delete all attributes lookup data code WC 10.4.3
private function delete_all_attributes_lookup_data( bool $truncate_table ) {
global $wpdb;
delete_option( 'woocommerce_attribute_lookup_enabled' );
delete_option( 'woocommerce_attribute_lookup_last_product_id_to_process' );
delete_option( 'woocommerce_attribute_lookup_processed_count' );
$this->data_store->unset_regeneration_in_progress_flag();
$this->data_store->unset_regeneration_aborted_flag();
if ( $truncate_table && $this->data_store->check_lookup_table_exists() ) {
$this->truncate_lookup_table();
}
}