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

WC_REST_System_Status_Tools_V2_Controller::update_item() public WC 1.0

Update (execute) a tool.

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

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

WP_Error/WP_REST_Response.

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

$WC_REST_System_Status_Tools_V2_Controller = new WC_REST_System_Status_Tools_V2_Controller();
$WC_REST_System_Status_Tools_V2_Controller->update_item( $request );
$request(WP_REST_Request) (обязательный)
Request data.

Код WC_REST_System_Status_Tools_V2_Controller::update_item() WC 4.7.0

<?php
public function update_item( $request ) {
	$tools = $this->get_tools();
	if ( empty( $tools[ $request['id'] ] ) ) {
		return new WP_Error( 'woocommerce_rest_system_status_tool_invalid_id', __( 'Invalid tool ID.', 'woocommerce' ), array( 'status' => 404 ) );
	}

	$tool = $tools[ $request['id'] ];
	$tool = array(
		'id'          => $request['id'],
		'name'        => $tool['name'],
		'action'      => $tool['button'],
		'description' => $tool['desc'],
	);

	$execute_return = $this->execute_tool( $request['id'] );
	$tool           = array_merge( $tool, $execute_return );

	/**
	 * Fires after a WooCommerce REST system status tool has been executed.
	 *
	 * @param array           $tool    Details about the tool that has been executed.
	 * @param WP_REST_Request $request The current WP_REST_Request object.
	 */
	do_action( 'woocommerce_rest_insert_system_status_tool', $tool, $request );

	$request->set_param( 'context', 'edit' );
	$response = $this->prepare_item_for_response( $tool, $request );
	return rest_ensure_response( $response );
}