LLMS_View_Manager::add_actions()

Add actions & filters


Description Description


Source Source

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

	public function add_actions() {

		// if user can't bypass restrictions don't do anything
		if ( ! llms_can_user_bypass_restrictions( get_current_user_id() ) ) {
			return;
		}

		// 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, 1 );
		add_filter( 'llms_is_course_enrollment_open', array( $this, 'modify_course_open' ), 10, 1 );

		// filters we'll only run when view as links are called
		if ( isset( $_GET['llms-view-as'] ) ) {

			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_action( 'wp_enqueue_scripts', array( $this, 'scripts' ) );

		}

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.7.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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





Permalink: