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

	public static function activate_keys( $keys ) {

		// 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(),
		);

		$req = new LLMS_Dot_Com_API( '/license/activate', $data );
		return $req->get_result();

	}


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.