WC_API_Authentication::update_api_key_last_access()privateWC 2.4.0

Updated API Key last access datetime

Method of the class: WC_API_Authentication{}

No Hooks.

Return

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->update_api_key_last_access( $key_id );
$key_id(int) (required)
-

Changelog

Since 2.4.0 Introduced.

WC_API_Authentication::update_api_key_last_access() code WC 8.7.0

private function update_api_key_last_access( $key_id ) {
	global $wpdb;

	$wpdb->update(
		$wpdb->prefix . 'woocommerce_api_keys',
		array( 'last_access' => current_time( 'mysql' ) ),
		array( 'key_id' => $key_id ),
		array( '%s' ),
		array( '%d' )
	);
}