Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
WC_Admin_API_Keys::get_key_data( int $key_id )
Get key data.
Description Description
Parameters Parameters
- $key_id
-
(Required) API Key ID.
Return Return
(array)
Source Source
File: includes/admin/class-wc-admin-api-keys.php
private static function get_key_data( $key_id ) { global $wpdb; $empty = array( 'key_id' => 0, 'user_id' => '', 'description' => '', 'permissions' => '', 'truncated_key' => '', 'last_access' => '', ); if ( 0 === $key_id ) { return $empty; } $key = $wpdb->get_row( $wpdb->prepare( "SELECT key_id, user_id, description, permissions, truncated_key, last_access FROM {$wpdb->prefix}woocommerce_api_keys WHERE key_id = %d", $key_id ), ARRAY_A ); if ( is_null( $key ) ) { return $empty; } return $key; }