WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Internal\ProductAttributesLookup

DataRegenerator::initiate_regeneration() public WC 1.0

Initialize the regeneration procedure: deletes the lookup table and related options if they exist, then it creates the table and runs the first step of the regeneration process.

This is the method that should be used as a callback for a data regeneration in wc-update-functions, e.g.:

function wc_update_XX_regenerate_product_attributes_lookup_table() { wc_get_container()->get(DataRegenerator::class)->initiate_regeneration(); return false; }

(Note how we are returning "false" since the class handles the step scheduling by itself).

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

No Hooks.

Return

null. Nothing.

Usage

$DataRegenerator = new DataRegenerator();
$DataRegenerator->initiate_regeneration();

Code of DataRegenerator::initiate_regeneration() WC 5.9.0

public function initiate_regeneration() {
	$this->enable_or_disable_lookup_table_usage( false );

	$this->delete_all_attributes_lookup_data();
	$products_exist = $this->initialize_table_and_data();
	if ( $products_exist ) {
		$this->enqueue_regeneration_step_run();
	} else {
		$this->finalize_regeneration();
	}
}