LLMS_Helper_Keys::activate_keys( string|array $keys )

Activate LifterLMS License Keys with the remote server.


Parameters Parameters

$keys

(string|array) (Required) Array or a white-space separated list of API keys.


Top ↑

Return Return

(array)


Top ↑

Source Source

File: libraries/lifterlms-helper/includes/class-llms-helper-keys.php

	 * @return array
	 */
	public static function activate_keys( $keys, $force = false ) {

		// Sanitize before sending.
		if ( ! is_array( $keys ) ) {
			$keys = explode( PHP_EOL, $keys );
		}

		$keys = array_map( 'sanitize_text_field', $keys );
		$keys = array_map( 'trim', $keys );
		$keys = array_unique( $keys );
		$keys = array_filter( $keys ); // Remove empty keys.

		$data = array(
			'keys' => $keys,
			'url'  => get_site_url(),
		);

		// Check for a cached result based on the keys and url input.
		$cache_hash = md5( wp_json_encode( $data ) );


Top ↑

Changelog Changelog

Changelog
Version Description
3.4.2 Removed empty key lines.
3.0.1 Unknown.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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