LLMS_REST_API_Keys_Controller::prepare_item_for_database( WP_REST_Request $request )
Prepare API Key for insert/update
Parameters Parameters
- $request
-
(WP_REST_Request) (Required) Request object.
Return Return
(WP_Error|array)
Source Source
File: libraries/lifterlms-rest/includes/server/class-llms-rest-api-keys-controller.php
$order = isset( $request['order'] ) ? $request['order'] : $params['order']['default']; $args['sort'] = array( $orderby => $order ); } return $args; } /** * Prepare API Key for insert/update * * @since 1.0.0-beta.1 * * @param WP_REST_Request $request Request object. * @return WP_Error|array */ protected function prepare_item_for_database( $request ) { $prepared = array(); if ( isset( $request['id'] ) ) { $existing = $this->get_object( $request['id'] ); if ( is_wp_error( $existing ) ) { return $existing; } $prepared['id'] = $existing->get( 'id' ); } $schema = $this->get_item_schema();
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.0.0-beta.1 | Introduced. |