Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Helper_Admin_Add_Ons::handle_deactivations()

Deactivate license keys with LifterLMS.com api


Description Description

Output errors / successes & removes keys from the db.


Top ↑

Return Return

(void)


Top ↑

Source Source

File: libraries/lifterlms-helper/includes/class-llms-helper-admin-add-ons.php

	 */
	private function handle_deactivations() {

		$keys = llms_filter_input( INPUT_POST, 'llms_remove_keys', FILTER_UNSAFE_RAW, FILTER_REQUIRE_ARRAY );
		$res  = LLMS_Helper_Keys::deactivate_keys( $keys );

		if ( is_wp_error( $res ) ) {
			LLMS_Admin_Notices::flash_notice( $res->get_error_message(), 'error' );
			return;
		}

		foreach ( $keys as $key ) {
			LLMS_Helper_Keys::remove_license_key( $key );
			/* Translators: %s = License Key */
			LLMS_Admin_Notices::flash_notice( sprintf( __( 'License key "%s" was removed from this site.', 'lifterlms' ), $key ), 'info' );
		}

		if ( isset( $data['errors'] ) ) {
			foreach ( $data['errors'] as $error ) {
				LLMS_Admin_Notices::flash_notice( make_clickable( $error ), 'error' );
			}
		}



Top ↑

Changelog Changelog

Changelog
Version Description
3.4.0 Use core textdomain.
3.2.0 Don't access $_POST directly.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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