Abstract_API_Key_Api::set_api_key_by_id( TECEvent_AutomatorZapierarray $api_key_data )

Set an API Key with the provided id.


Parameters

$api_key_data

(<span class="TECEvent_AutomatorZapierarrayTECEvent_AutomatorZapierarray<string|">TECEvent_AutomatorZapierstring>) (Required) A specific api_key data to save.


Top ↑

Source

File: src/Common/Event_Automator/Zapier/Abstract_API_Key_Api.php

	public function set_api_key_by_id( array $api_key_data ) {
		// hash the consumer id and secret if they start with the prefix.
		$api_key_data['consumer_id'] = strpos( $api_key_data['consumer_id'], 'ci_' ) === 0
			? static::api_hash( $api_key_data['consumer_id'] )
			: $api_key_data['consumer_id'];

		$api_key_data['consumer_secret'] = strpos( $api_key_data['consumer_secret'], 'ck_' ) === 0
			? static::api_hash( $api_key_data['consumer_secret'] )
			: $api_key_data['consumer_secret'];

		update_option( $this->single_api_key_prefix . $api_key_data['consumer_id'], $api_key_data, false );

		$this->update_list_of_api_keys( $api_key_data );
	}

Top ↑

Changelog

Changelog
Version Description
6.0.0 Introduced.