Automattic\WooCommerce\Admin\API\Reports\Import

Controller::cancel_import()publicWC 1.0

Cancel all queued import actions.

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

Хуков нет.

Возвращает

WP_Error|WP_REST_Response.

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

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

Код Controller::cancel_import() WC 6.6.1

public function cancel_import( $request ) {
	ReportsSync::clear_queued_actions();

	$result = array(
		'status'  => 'success',
		'message' => __( 'All pending and in-progress import actions have been cancelled.', 'woocommerce' ),
	);

	$response = $this->prepare_item_for_response( $result, $request );
	$data     = $this->prepare_response_for_collection( $response );

	return rest_ensure_response( $data );
}