LLMS_REST_Admin_Form_Controller::handle_key_download()

Generate and download a api key credentials file.


Return Return

(false|void)


Top ↑

Source Source

File: libraries/lifterlms-rest/includes/admin/class-llms-rest-admin-form-controller.php

	protected function handle_key_download() {

		$info = $this->prepare_key_download();
		if ( ! $info ) {
			return false;
		}

		header( 'Content-type: text/plain' );
		header( 'Content-Disposition: attachment; filename="' . $info['fn'] );
		header( 'Pragma: no-cache' );
		header( 'Expires: 0' );

		// Translators: %s = Consumer Key.
		printf( __( 'Consumer Key: %s', 'lifterlms' ), $info['ck'] );
		echo "\r\n";
		// Translators: %s = Consumer Secret.
		printf( __( 'Consumer Secret: %s', 'lifterlms' ), $info['cs'] );
		die();

	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0-beta.3 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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