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.
Return Return
(array)
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;
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 5.9.0 | Pass the course ID to llms_can_user_bypass_restrictions(). |
| 3.7.0 | Introduced. |