Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
LLMS_Roles::get_core_caps( string $role )
Retrieve the LifterLMS core capabilities for a give role
Parameters Parameters
- $role
-
(string) (Required) Name of the role.
Return Return
(string[])
Source Source
File: includes/class.llms.roles.php
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | private static function get_core_caps( $role ) { $all_caps = array_fill_keys( array_values ( self::get_all_core_caps() ), true ); switch ( $role ) { case 'instructor' : case 'instructors_assistant' : $caps = $all_caps ; unset( $caps [ 'enroll' ], $caps [ 'unenroll' ], $caps [ 'manage_lifterlms' ], $caps [ self::MANAGE_EARNED_ENGAGEMENT_CAP ], $caps [ 'view_others_lifterlms_reports' ], $caps [ 'create_students' ], $caps [ 'view_others_students' ], $caps [ 'edit_students' ], $caps [ 'edit_others_students' ], $caps [ 'delete_students' ], $caps [ 'delete_others_students' ], $caps [ 'view_grades' ] ); break ; case 'administrator' : case 'lms_manager' : $caps = $all_caps ; break ; default : $caps = array (); } /** * Filters the LifterLMS capabilities added to a LifterLMS user role. * * The dynamic portion of this hook `$role` refers to the user's role name. * * @since 4.21.2 * * @param string[] $caps List of capabilities provided to the role. * @param string[] $all_caps Full list of all LifterLMS user capabilities. */ return apply_filters( "llms_get_{$role}_core_caps" , $caps , $all_caps ); } |
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
6.0.0 | Added manage_earned_engagement to the list of instructor/assistant caps which are not automatically available. |
4.21.2 | Added 'view_grades' to the list of instructor/assistant caps which are not automatically available. |
3.34.0 | Added student management capabilities. |
3.13.0 | Introduced. |