WordPress at Your Fingertips
function is not described

WC_Payment_Token_Data_Store::get_token_type_by_id() public WC 3.0.0

Get a token's type by ID.

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

No Hooks.

Return

String.

Usage

$WC_Payment_Token_Data_Store = new WC_Payment_Token_Data_Store();
$WC_Payment_Token_Data_Store->get_token_type_by_id( $token_id );
$token_id(int) (required)
Token ID.

Changelog

Since 3.0.0 Introduced.

Code of WC_Payment_Token_Data_Store::get_token_type_by_id() WC 5.8.0

public function get_token_type_by_id( $token_id ) {
	global $wpdb;
	return $wpdb->get_var(
		$wpdb->prepare(
			"SELECT type FROM {$wpdb->prefix}woocommerce_payment_tokens WHERE token_id = %d",
			$token_id
		)
	);
}