LLMS_REST_Lessons_Controller::get_filters_to_be_removed_for_response( LLMS_Lesson $lesson )
Get action/filters to be removed before preparing the item for response.
Parameters Parameters
- $lesson
-
(LLMS_Lesson) (Required) Lesson object.
Return Return
(array) Array of action/filters to be removed for response.
Source Source
File: libraries/lifterlms-rest/includes/server/class-llms-rest-lessons-controller.php
protected function get_filters_to_be_removed_for_response( $lesson ) { $filters = array(); if ( llms_blocks_is_post_migrated( $lesson->get( 'id' ) ) ) { $filters = array( // hook => [callback, priority]. 'lifterlms_single_lesson_after_summary' => array( // Lesson Navigation. array( 'callback' => 'lifterlms_template_lesson_navigation', 'priority' => 20, ), // Lesson Progression. array( 'callback' => 'lifterlms_template_complete_lesson_link', 'priority' => 10, ), ), ); } /** * Modify the array of filters to be removed before building the response. * * @since 1.0.0-beta.9 * * @param array $filters Array of filters to be removed. * @param LLMS_Lesson $lesson Lesson object. */ return apply_filters( 'llms_rest_lesson_filters_removed_for_response', $filters, $lesson ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
1.0.0-beta.9 | llms_rest_lesson_filters_removed_for_response filter hook added. |
1.0.0-beta.7 | Fixed lesson progression callback name. |
1.0.0-beta.1 | Introduced. |