diff --git a/includes/server/class-llms-rest-lessons-controller.php b/includes/server/class-llms-rest-lessons-controller.php index 63b1880f..5b37ff09 100644 --- a/includes/server/class-llms-rest-lessons-controller.php +++ b/includes/server/class-llms-rest-lessons-controller.php @@ -91,7 +91,6 @@ public function __construct() { parent::__construct(); $this->collection_params = $this->build_collection_params(); - } /** @@ -254,7 +253,6 @@ protected function prepare_item_for_database( $request ) { * @param array $schema The item schema. */ return apply_filters( 'llms_rest_pre_insert_lesson', $prepared_item, $request, $schema ); - } /** @@ -307,7 +305,6 @@ protected function update_additional_object_fields( $lesson, $request, $schema, } return ! empty( $to_set ); - } /** @@ -469,7 +466,6 @@ protected function get_item_schema_base() { $schema['properties'] = array_merge( (array) $schema['properties'], $lesson_properties ); return $schema; - } /** @@ -513,7 +509,6 @@ public function build_collection_params() { ); return $query_params; - } /** @@ -597,7 +592,6 @@ protected function prepare_object_for_response( $lesson, $request ) { * @param WP_REST_Request $request Full details about the request. */ return apply_filters( 'llms_rest_prepare_lesson_object_response', $data, $lesson, $request ); - } /** @@ -694,7 +688,6 @@ protected function get_filters_to_be_removed_for_response( $lesson ) { * @param LLMS_Lesson $lesson Lesson object. */ return apply_filters( 'llms_rest_lesson_filters_removed_for_response', $filters, $lesson ); - } /** @@ -774,14 +767,6 @@ protected function prepare_links( $lesson, $request ) { ); } - // Quiz. - if ( $lesson->is_quiz_enabled() ) { - $quiz = $lesson->get_quiz(); - $lesson_links['quiz'] = array( - 'href' => rest_url( sprintf( '/%s/%s/%d', 'llms/v1', 'quizzes', $quiz->get( 'id' ) ) ), - ); - } - $links = array_merge( $links, $lesson_links ); /** @@ -793,7 +778,6 @@ protected function prepare_links( $lesson, $request ) { * @param LLMS_Lesson $lesson Lesson object. */ return apply_filters( 'llms_rest_lesson_links', $links, $lesson ); - } /** @@ -821,7 +805,5 @@ protected function check_read_permission( $lesson ) { * At the moment we grant lessons read permission only to who can edit lessons. */ return parent::check_update_permission( $lesson ); - } - }