Automattic\WooCommerce\Internal\ProductAttributesLookup

DataRegenerator::delete_all_attributes_lookup_data()privateWC 1.0

Delete all the existing data related to the lookup table, including the table itself.

Метод класса: DataRegenerator{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// private - только в коде основоного (родительского) класса
$result = $this->delete_all_attributes_lookup_data();

Код DataRegenerator::delete_all_attributes_lookup_data() WC 8.7.0

private function delete_all_attributes_lookup_data() {
	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();

	if ( $this->data_store->check_lookup_table_exists() ) {
		$wpdb->query( "TRUNCATE TABLE {$this->lookup_table_name}" ); // phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared
	}
}