Automattic\WooCommerce\Internal\PushNotifications\Entities

PushToken::to_wpcom_formatpublicWC 10.7.0

Returns this token formatted for the WPCOM push notifications endpoint.

Method of the class: PushToken{}

No Hooks.

Returns

Array{user_id:. int|null, token: string|null, origin: string|null, device_locale: string|null}

Usage

$PushToken = new PushToken();
$PushToken->to_wpcom_format(): array;

Changelog

Since 10.7.0 Introduced.

PushToken::to_wpcom_format() code WC 10.8.1

public function to_wpcom_format(): array {
	return array(
		'user_id'       => $this->user_id,
		'token'         => $this->token,
		'origin'        => $this->origin,
		'device_locale' => $this->device_locale ?? self::DEFAULT_DEVICE_LOCALE,
	);
}