WC_REST_Products_V1_Controller::save_product()publicWC 1.0

Saves a product to the database.

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

Хуков нет.

Возвращает

int.

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

$WC_REST_Products_V1_Controller = new WC_REST_Products_V1_Controller();
$WC_REST_Products_V1_Controller->save_product( $request );
$request(WP_REST_Request) (обязательный)
Full details about the request.

Код WC_REST_Products_V1_Controller::save_product() WC 9.3.3

public function save_product( $request ) {
	$product = $this->prepare_item_for_database( $request );
	return $product->save();
}