LLMS_REST_Webhooks_Controller::prepare_object_for_response( LLMS_Abstract_User_Data $object, WP_REST_Request $request )

Prepare an object for response.


Parameters Parameters

$object

(LLMS_Abstract_User_Data) (Required) User object.

$request

(WP_REST_Request) (Required) Request object.


Top ↑

Return Return

(array)


Top ↑

Source Source

File: libraries/lifterlms-rest/includes/server/class-llms-rest-webhooks-controller.php

	protected function prepare_object_for_response( $object, $request ) {

		$prepared = parent::prepare_object_for_response( $object, $request );

		$prepared['id']       = absint( $prepared['id'] );
		$prepared['resource'] = $object->get_resource();
		$prepared['event']    = $object->get_event();
		$prepared['hooks']    = $object->get_hooks();
		$prepared['created']  = mysql_to_rfc3339( $prepared['created'] );
		$prepared['updated']  = mysql_to_rfc3339( $prepared['updated'] );

		return $prepared;

	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0-beta.3 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.