WC_Payment_Tokens::delete()public staticWC 2.6.0

Remove a payment token from the database by ID.

Method of the class: WC_Payment_Tokens{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = WC_Payment_Tokens::delete( $token_id );
$token_id(int) (required)
Token ID.

Changelog

Since 2.6.0 Introduced.

WC_Payment_Tokens::delete() code WC 8.7.0

public static function delete( $token_id ) {
	$type = self::get_token_type_by_id( $token_id );
	if ( ! empty( $type ) ) {
		$class = self::get_token_classname( $type );
		$token = new $class( $token_id );
		$token->delete();
	}
}