WC_Payment_Token_Data_Store::delete()publicWC 3.0.0

Remove a payment token from the database.

Method of the class: WC_Payment_Token_Data_Store{}

Hooks from the method

Return

null. Nothing (null).

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.

WC_Payment_Token_Data_Store::delete() code WC 9.4.2

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 );
}