llms_can_user_bypass_restrictions( obj|int $user = null )
Determine whether or not a user can bypass enrollment, drip, and prerequisite restrictions
Description Description
Parameters Parameters
- $user
-
(obj|int) (Optional) LLMS_Student, WP_User, or WP User ID, if none supplied get_current_user() will be used
Default value: null
Return Return
(boolean)
Source Source
File: includes/functions/llms.functions.person.php
function llms_can_user_bypass_restrictions( $user = null ) { $user = llms_get_student( $user ); if ( ! $user ) { return false; } $roles = get_option( 'llms_grant_site_access', '' ); if ( ! $roles ) { $roles = array(); } if ( array_intersect( $user->get_user()->roles, $roles ) ) { return true; } return false; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.7.0 | Introduced. |
User Contributed Notes User Contributed Notes
Permalink: