WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Internal\ProductAttributesLookup

LookupDataStore::on_product_changed() public WC 1.0

Insert/update the appropriate lookup table entries for a new or modified product or variation. This must be invoked after a product or a variation is created (including untrashing and duplication) or modified.

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

No Hooks.

Return

null. Nothing.

Usage

$LookupDataStore = new LookupDataStore();
$LookupDataStore->on_product_changed( $product, $changeset );
$product(int|\WC_Product) (required)
Product object or product id.
$changeset(null|array)
Changes as provided by 'get_changes' method in the product object, null if it's being created.
Default: null

Code of LookupDataStore::on_product_changed() WC 5.9.0

public function on_product_changed( $product, $changeset = null ) {
	if ( ! $this->check_lookup_table_exists() ) {
		return;
	}

	if ( ! is_a( $product, \WC_Product::class ) ) {
		$product = WC()->call_function( 'wc_get_product', $product );
	}

	$action = $this->get_update_action( $changeset );
	if ( self::ACTION_NONE !== $action ) {
		$this->maybe_schedule_update( $product->get_id(), $action );
	}
}