WordPress at Your Fingertips
function is not described

WC_REST_Authentication::get_user_data_by_consumer_key() private WC 1.0

Return the user data for the given consumer_key.

{} It's a method of the class: WC_REST_Authentication{}

No Hooks.




// private - for code of main (parent) class only
$result = $this->get_user_data_by_consumer_key( $consumer_key );
$consumer_key(string) (required)
Consumer key.

Code of WC_REST_Authentication::get_user_data_by_consumer_key() WC 5.9.0

private function get_user_data_by_consumer_key( $consumer_key ) {
	global $wpdb;

	$consumer_key = wc_api_hash( sanitize_text_field( $consumer_key ) );
	$user         = $wpdb->get_row(
		SELECT key_id, user_id, permissions, consumer_key, consumer_secret, nonces
		FROM {$wpdb->prefix}woocommerce_api_keys
		WHERE consumer_key = %s

	return $user;