WordPress at Your Fingertips
function is not described

WC_Payment_Token_Data_Store::delete() public WC 3.0.0

Remove a payment token from the database.

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

Hooks from the method
Return

null. Nothing.

Usage

$WC_Payment_Token_Data_Store = new WC_Payment_Token_Data_Store();
$WC_Payment_Token_Data_Store->delete( $token, $force_delete );
$token(WC_Payment_Token) (required) (passed by reference — &)
Payment token object.
$force_delete(true|false)
Unused param.
Default: false

Changelog

Since 3.0.0 Introduced.

Code of WC_Payment_Token_Data_Store::delete() WC 5.6.0

public function delete( &$token, $force_delete = false ) {
	global $wpdb;
	$wpdb->delete( $wpdb->prefix . 'woocommerce_payment_tokens', array( 'token_id' => $token->get_id() ), array( '%d' ) );
	$wpdb->delete( $wpdb->prefix . 'woocommerce_payment_tokenmeta', array( 'payment_token_id' => $token->get_id() ), array( '%d' ) );
	do_action( 'woocommerce_payment_token_deleted', $token->get_id(), $token );
}