LLMS_REST_Controller_Stubs::update_object( array $prepared, WP_REST_Request $request )
Update the object in the database with prepared data.
Parameters Parameters
- $prepared
-
(array) (Required) Prepared item data.
- $request
-
(WP_REST_Request) (Required) Request object.
Return Return
(obj) Object Instance of object from $this->get_object().
Source Source
File: libraries/lifterlms-rest/includes/abstracts/class-llms-rest-controller-stubs.php
*/ protected function prepare_object_for_response( $object, $request ) { if ( ! method_exists( $object, 'get' ) ) { // Translators: %s = method name. _doing_it_wrong( 'LLMS_REST_Controller::prepare_object_for_response', sprintf( __( "Method '%s' must be overridden.", 'lifterlms' ), __METHOD__ ), '1.0.0-beta.1' ); } $prepared = array(); $map = array_flip( $this->map_schema_to_database() ); $fields = $this->get_fields_for_response( $request );
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.0.0-beta.1 | Introduced. |