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.


Top ↑

Return Return

(array)


Top ↑

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'] ) ) {


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.