LLMS_Helper_Keys::deactivate_keys( array $keys )

Deactivate LifterLMS API keys with remote server


Parameters Parameters

$keys

(array) (Required) Array of keys.


Top ↑

Return Return

(array)


Top ↑

Source Source

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

	public static function deactivate_keys( $keys ) {

		$keys = array_map( 'sanitize_text_field', $keys );
		$keys = array_map( 'trim', $keys );

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

		$saved = llms_helper_options()->get_license_keys();
		foreach ( $keys as $key ) {
			if ( isset( $saved[ $key ] ) && $saved[ $key ]['update_key'] ) {
				$data['keys'][ $key ] = $saved[ $key ]['update_key'];
			}
		}

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

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.4.1 Ensure key exists before attempting to deactivate it.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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