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


Top ↑

Return Return

(void)


Top ↑

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

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.