WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WC_REST_Products_V1_Controller::update_item() public WC 1.0

Update a single product.

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

Хуки из метода
Возвращает

WP_Error/WP_REST_Response.

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

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

Код WC_REST_Products_V1_Controller::update_item() WC 4.5.2

woocommerce/includes/rest-api/Controllers/Version1/class-wc-rest-products-v1-controller.php
<?php
public function update_item( $request ) {
	$post_id = (int) $request['id'];

	if ( empty( $post_id ) || get_post_type( $post_id ) !== $this->post_type ) {
		return new WP_Error( "woocommerce_rest_{$this->post_type}_invalid_id", __( 'ID is invalid.', 'woocommerce' ), array( 'status' => 400 ) );
	}

	try {
		$product_id = $this->save_product( $request );
		$post       = get_post( $product_id );
		$this->update_additional_fields_for_object( $post, $request );
		$this->update_post_meta_fields( $post, $request );

		/**
		 * Fires after a single item is created or updated via the REST API.
		 *
		 * @param WP_Post         $post      Post data.
		 * @param WP_REST_Request $request   Request object.
		 * @param boolean         $creating  True when creating item, false when updating.
		 */
		do_action( 'woocommerce_rest_insert_product', $post, $request, false );
		$request->set_param( 'context', 'edit' );
		$response = $this->prepare_item_for_response( $post, $request );

		return rest_ensure_response( $response );
	} catch ( WC_Data_Exception $e ) {
		return new WP_Error( $e->getErrorCode(), $e->getMessage(), $e->getErrorData() );
	} catch ( WC_REST_Exception $e ) {
		return new WP_Error( $e->getErrorCode(), $e->getMessage(), array( 'status' => $e->getCode() ) );
	}
}