WordPress at Your Fingertips
function is not described

WC_REST_Telemetry_Controller::get_usage_data() public WC 1.0

Get usage data from current request

{} It's a method of the class: WC_REST_Telemetry_Controller{}

No Hooks.

Return

Array.

Usage

$WC_REST_Telemetry_Controller = new WC_REST_Telemetry_Controller();
$WC_REST_Telemetry_Controller->get_usage_data( $request );
$request(WP_REST_Request) (required)
Full details about the request.

Code of WC_REST_Telemetry_Controller::get_usage_data() WC 5.9.0

public function get_usage_data( $request ) {
	$platform = strtolower( $request->get_param( 'platform' ) );
	switch ( $platform ) {
		case 'ios':
		case 'android':
			break;
		default:
			return;
	}

	$version = $request->get_param( 'version' );
	if ( ! $version ) {
		return;
	}

	return array(
		'platform'  => sanitize_text_field( $platform ),
		'version'   => sanitize_text_field( $version ),
		'last_used' => gmdate( 'c' ),
	);
}