LLMS_Rest_Admin_Settings_API_Keys::save_create()

Form handler to create a new API key.


Return Return

(LLMS_REST_API_Key|WP_Error)


Top ↑

Source Source

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

263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
*/
protected static function save_create() {
 
    $create = LLMS_REST_API()->keys()->create(
        array(
            'description' => llms_filter_input_sanitize_string( INPUT_POST, 'llms_rest_key_description' ),
            'user_id'     => llms_filter_input( INPUT_POST, 'llms_rest_key_user_id', FILTER_SANITIZE_NUMBER_INT ),
            'permissions' => llms_filter_input_sanitize_string( INPUT_POST, 'llms_rest_key_permissions' ),
        )
    );
 
    if ( ! is_wp_error( $create ) ) {
        self::$generated_key = $create;
    }
 
    return $create;


Top ↑

Changelog Changelog

Changelog
Version Description
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.