Skip to content

Commit

Permalink
Remove quiz resource link from lessons until quiz resource added.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianhogg committed Jul 17, 2024
1 parent 574a47a commit eb7ddb5
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions includes/server/class-llms-rest-lessons-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ public function __construct() {
parent::__construct();

$this->collection_params = $this->build_collection_params();

}

/**
Expand Down Expand Up @@ -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 );

}

/**
Expand Down Expand Up @@ -307,7 +305,6 @@ protected function update_additional_object_fields( $lesson, $request, $schema,
}

return ! empty( $to_set );

}

/**
Expand Down Expand Up @@ -469,7 +466,6 @@ protected function get_item_schema_base() {
$schema['properties'] = array_merge( (array) $schema['properties'], $lesson_properties );

return $schema;

}

/**
Expand Down Expand Up @@ -513,7 +509,6 @@ public function build_collection_params() {
);

return $query_params;

}

/**
Expand Down Expand Up @@ -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 );

}

/**
Expand Down Expand Up @@ -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 );

}

/**
Expand Down Expand Up @@ -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 );

/**
Expand All @@ -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 );

}

/**
Expand Down Expand Up @@ -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 );

}

}

0 comments on commit eb7ddb5

Please sign in to comment.