LLMS_View_Manager::modify_restrictions( array $restrictions )

Modify llms_page_restricted for qualifying users to allow them to bypass restrictions.


Parameters Parameters

$restrictions

(array) (Required) Restriction data.


Top ↑

Return Return

(array)


Top ↑

Source Source

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

	public function modify_restrictions( $restrictions ) {

		if (
			'self' === $this->get_view() &&
			llms_can_user_bypass_restrictions( get_current_user_id(), $restrictions['restriction_id'] )
		) {

			$restrictions['is_restricted'] = false;
			$restrictions['reason']        = 'role-access';

		}

		return $restrictions;
	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.9.0 Pass the course ID to llms_can_user_bypass_restrictions().
3.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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