LLMS_REST_Authentication::find_key( string $consumer_key )

Find a key via unhashed consumer key


Parameters Parameters

$consumer_key

(string) (Required) An unhashed consumer key.


Top ↑

Return Return

(LLMS_REST_API_Key|false)


Top ↑

Source Source

File: libraries/lifterlms-rest/includes/class-llms-rest-authentication.php

	protected function find_key( $consumer_key ) {

		global $wpdb;

		$consumer_key = llms_rest_api_hash( $consumer_key );

		$key_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$wpdb->prefix}lifterlms_api_keys WHERE consumer_key = %s", $consumer_key ) ); // no-cache ok.

		if ( $key_id ) {
			return LLMS_REST_API()->keys()->get( $key_id );
		}

		return false;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0-beta.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.