WordPress at a glance
function is not described

WP_REST_Controller::prepare_item_for_database() protected WP 4.7.0

Prepares one item for create or update operation.

{} It's a method of the class: WP_REST_Controller{}

No Hooks.

Return

Object/WP_Error. The prepared item, or WP_Error object on failure.

Usage

// protected - for code of main (parent) or child class
$result = $this->prepare_item_for_database( $request );
$request(WP_REST_Request) (required)
Request object.

Changelog

Since 4.7.0 Introduced.

Code of WP_REST_Controller::prepare_item_for_database() WP 5.5.1

<?php
protected function prepare_item_for_database( $request ) {
	return new WP_Error(
		'invalid-method',
		/* translators: %s: Method name. */
		sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ),
		array( 'status' => 405 )
	);
}