LLMS_REST_Sections_Controller::prepare_object_for_response( LLMS_Section $section, WP_REST_Request $request )

Prepare a single object output for response.


Parameters Parameters

$section

(LLMS_Section) (Required) Section object.

$request

(WP_REST_Request) (Required) Full details about the request.


Top ↑

Return Return

(array)


Top ↑

Source Source

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

	 * @param LLMS_Section    $section Section object.
	 * @param WP_REST_Request $request Full details about the request.
	 * @return array
	 */
	protected function prepare_object_for_response( $section, $request ) {

		$data = parent::prepare_object_for_response( $section, $request );

		// Parent course.
		$data['parent_id'] = $section->get( 'parent_course' );

		// Order.
		$data['order'] = $section->get( 'order' );


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0-beta.23 Replaced call to deprecated LLMS_Section::get_parent_course() with LLMS_Section::get( 'parent_course' ).
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.