Abstract_API_Key_Api::set_api_key_last_access( string $consumer_id, string $app_name = '' )
Updates the last access valid access of the API Key pair.
Contents
Parameters
- $consumer_id
-
(string) (Required) The id of the single api_key.
- $app_name
-
(string) (Optional) The optional app name used with this API key pair.
Default value: ''
Source
File: src/Common/Event_Automator/Zapier/Abstract_API_Key_Api.php
public function set_api_key_last_access( $consumer_id ) {
$hashed_consumer_id = strpos( $consumer_id, 'ci_' ) === 0
? static::api_hash($consumer_id )
: $consumer_id;
$api_key_data = $this->get_api_key_by_id( $hashed_consumer_id );
$timezone_object = Timezones::build_timezone_object();
$date = new Date_I18n( 'now', $timezone_object );
$api_key_data['last_access'] = $date->format( 'Y-m-d H:i:s' );
update_option( $this->single_api_key_prefix . $hashed_consumer_id, $api_key_data, false );
}
Changelog
| Version | Description |
|---|---|
| 6.0.0 | Introduced. |