WC_Payment_Token_Data_Store::set_default_status( int $token_id, bool $status = true )
Update’s a tokens default status in the database. Used for quickly looping through tokens and setting their statuses instead of creating a bunch of objects.
Description Description
Parameters Parameters
- $token_id
-
(Required) Token ID.
- $status
-
(Optional) Whether given payment token is the default payment token or not.
Default value: true
Return Return
(void)
Source Source
File: includes/data-stores/class-wc-payment-token-data-store.php
public function set_default_status( $token_id, $status = true ) { global $wpdb; $wpdb->update( $wpdb->prefix . 'woocommerce_payment_tokens', array( 'is_default' => $status ), array( 'token_id' => $token_id, ) ); }
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |