LLMS_View_Manager::add_actions()

Add actions & filters.


Return Return

(void)


Top ↑

Source Source

File: includes/class.llms.view.manager.php

	public function add_actions() {

		// Output view links on the admin menu.
		add_action( 'admin_bar_menu', array( $this, 'add_menu_items' ), 777 );

		// Filter page restrictions.
		add_filter( 'llms_page_restricted', array( $this, 'modify_restrictions' ), 10, 1 );
		add_filter( 'llms_is_course_open', array( $this, 'modify_course_open' ), 10, 2 );
		add_filter( 'llms_is_course_enrollment_open', array( $this, 'modify_course_open' ), 10, 2 );

		// Filters we'll only run when view as links are called.
		if ( isset( $_GET['llms-view-as'] ) ) { // phpcs:disable WordPress.Security.NonceVerification.Recommended

			add_filter( 'llms_is_course_complete', array( $this, 'modify_completion' ), 10, 1 );
			add_filter( 'llms_is_lesson_complete', array( $this, 'modify_completion' ), 10, 1 );
			add_filter( 'llms_is_track_complete', array( $this, 'modify_completion' ), 10, 1 );

			add_filter( 'llms_get_enrollment_status', array( $this, 'modify_enrollment_status' ), 10, 1 );

			add_filter( 'llms_display_free_enroll_form', array( $this, 'modify_display_free_enroll_form' ), 10, 1 );

			add_filter( 'llms_display_student_dashboard', array( $this, 'modify_dashboard' ), 10, 1 );
			add_filter( 'llms_hide_registration_form', array( $this, 'modify_dashboard' ), 10, 1 );
			add_filter( 'llms_enable_open_registration', array( $this, 'enable_open_reg' ), 10, 1 );
			add_filter( 'llms_hide_login_form', array( $this, 'modify_dashboard' ), 10, 1 );

			add_action( 'wp_enqueue_scripts', array( $this, 'scripts' ) );

		}

	}

Top ↑

Changelog Changelog

Changelog
Version Description
5.9.0 Pass second parameter to modify_course_open() methods.
4.2.0 Added filter to handle the displaying of the free enroll.
4.16.0 Added filters to handle modification of the student dashboard.
3.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.