Automattic\WooCommerce\Internal\ProductAttributesLookup

LookupDataStore::on_product_created_or_updated_via_rest_api()privateWC 1.0

Handler for the woocommerce_rest_insert_product hook. Needed to update the lookup table when the REST API batch insert/update endpoints are used.

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

No Hooks.

Return

null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->on_product_created_or_updated_via_rest_api( $product, $request ): void;
$product(\WP_Post) (required)
The post representing the created or updated product.
$request(\WP_REST_Request) (required)
The REST request that caused the hook to be fired.

Код LookupDataStore::on_product_created_or_updated_via_rest_api() WC 7.1.0

private function on_product_created_or_updated_via_rest_api( \WP_Post $product, \WP_REST_Request $request ): void {
	if ( StringUtil::ends_with( $request->get_route(), '/batch' ) ) {
		$this->on_product_changed( $product->ID );
	}
}