LLMS_Rest_Admin_Settings_API_Keys::save()

Form handler to save Create / Update an API key.


Return Return

(null|LLMS_REST_API_Key|WP_Error)


Top ↑

Source Source

File: libraries/lifterlms-rest/includes/admin/class-llms-rest-admin-settings-api-keys.php

	public static function save() {

		$ret = null;

		$key_id = llms_filter_input( INPUT_GET, 'edit-key', FILTER_SANITIZE_NUMBER_INT );
		if ( $key_id ) {
			$ret = self::save_update( $key_id );
		} elseif ( llms_filter_input( INPUT_GET, 'add-key', FILTER_SANITIZE_NUMBER_INT ) ) {
			$ret = self::save_create();
		}

		if ( is_wp_error( $ret ) ) {
			// Translators: %1$s = Error message; %2$s = Error code.
			LLMS_Admin_Settings::set_error( sprintf( __( 'Error: %1$s [Code: %2$s]', 'lifterlms' ), $ret->get_error_message(), $ret->get_error_code() ) );
		}

		return $ret;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0-beta.3 Remove key copy message in favor of message directly above the key fields.
1.0.0-beta.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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