LLMS_REST_Users_Controller::prepare_item_for_database( WP_Rest_Request $request )
Prepare request arguments for a database insert/update
Parameters Parameters
- $request
-
(WP_Rest_Request) (Required) Request object.
Return Return
(array)
Source Source
File: libraries/lifterlms-rest/includes/abstracts/class-llms-rest-users-controller.php
} /** * Prepare request arguments for a database insert/update * * @since 1.0.0-beta.1 * * @param WP_Rest_Request $request Request object. * @return array */ protected function prepare_item_for_database( $request ) { $prepared = parent::prepare_item_for_database( $request ); // If we're creating a new item, maybe add some defaults. if ( empty( $prepared['id'] ) ) { // Pass an explicit false to `wp_insert_user()`. $prepared['role'] = false; if ( empty( $prepared['user_pass'] ) ) {
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.0.0-beta.1 | Introduced. |