Automattic\WooCommerce\Internal\ProductAttributesLookup

DataRegenerator::run_woocommerce_installed_callback()privateWC 1.0

Run additional setup needed after a WooCommerce install or update finishes.

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

Хуков нет.

Возвращает

null. Ничего.

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

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

Код DataRegenerator::run_woocommerce_installed_callback() WC 6.8.0

private function run_woocommerce_installed_callback() {
	// The table must exist at this point (created via dbDelta), but we check just in case.
	if ( ! $this->data_store->check_lookup_table_exists() ) {
		return;
	}

	// If a table regeneration is in progress, leave it alone.
	if ( $this->data_store->regeneration_is_in_progress() ) {
		return;
	}

	// If the lookup table has data, or if it's empty because there are no products yet, we're good.
	// Otherwise (lookup table is empty but products exist) we need to initiate a regeneration if one isn't already in progress.
	if ( $this->data_store->lookup_table_has_data() || ! $this->get_last_existing_product_id() ) {
		$must_enable = 'no' !== get_option( 'woocommerce_attribute_lookup_enabled' );
		$this->finalize_regeneration( $must_enable );
	} else {
		$this->initiate_regeneration();
	}
}