LLMS_REST_Courses_Controller::get_filters_to_be_removed_for_response( LLMS_Course $course )

Get action/filters to be removed before preparing the item for response.


Parameters Parameters

$course

(LLMS_Course) (Required) Course object.


Top ↑

Return Return

(array) Array of action/filters to be removed for response.


Top ↑

Source Source

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

		return isset( $taxonomy_base_map[ $base ] ) ? $taxonomy_base_map[ $base ] : $base;

	}

	/**
	 * Get action/filters to be removed before preparing the item for response.
	 *
	 * @since 1.0.0-beta.1
	 * @since 1.0.0-beta.9 `llms_rest_course_filters_removed_for_response` filter hook added.
	 *
	 * @param LLMS_Course $course Course object.
	 * @return array Array of action/filters to be removed for response.
	 */
	protected function get_filters_to_be_removed_for_response( $course ) {

		$filters = array();

		if ( llms_blocks_is_post_migrated( $course->get( 'id' ) ) ) {
			$filters = array(
				// hook => [callback, priority].
				'lifterlms_single_course_after_summary' => array(
					// Course Information.
					array(
						'callback' => 'lifterlms_template_single_meta_wrapper_start',
						'priority' => 5,
					),
					array(
						'callback' => 'lifterlms_template_single_length',
						'priority' => 10,
					),
					array(
						'callback' => 'lifterlms_template_single_difficulty',
						'priority' => 20,
					),
					array(
						'callback' => 'lifterlms_template_single_course_tracks',
						'priority' => 25,
					),
					array(
						'callback' => 'lifterlms_template_single_course_categories',
						'priority' => 30,
					),
					array(
						'callback' => 'lifterlms_template_single_course_tags',
						'priority' => 35,
					),
					array(
						'callback' => 'lifterlms_template_single_meta_wrapper_end',
						'priority' => 50,
					),
					// Course Progress.
					array(
						'callback' => 'lifterlms_template_single_course_progress',
						'priority' => 60,
					),
					// Course Syllabus.
					array(
						'callback' => 'lifterlms_template_single_syllabus',
						'priority' => 90,
					),
					// Instructors.
					array(
						'callback' => 'lifterlms_template_course_author',
						'priority' => 40,
					),
					// Pricing Table.
					array(
						'callback' => 'lifterlms_template_pricing_table',
						'priority' => 60,
					),
				),


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0-beta.9 llms_rest_course_filters_removed_for_response filter hook added.
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.