PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.9.1
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.9.1
4.4.9.1 4.4.9 4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 All 141 releases
learnpress / config / user-roles-caps.php

user-roles-caps.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.4.9.1, at config/user-roles-caps.php

53 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Role default
4 *
5 * @package LearnPress/Config
6 * @version 1.0.0
7 * @since 4.4.2
8 */
9
10 use LearnPress\Models\UserModel;
11
12 defined( 'ABSPATH' ) || exit;
13
14 $config = [];
15
16 $config[ UserModel::ROLE_INSTRUCTOR ] = apply_filters(
17 'learn-press/role/instructor/capabilities_default',
18 [
19 'label' => 'Instructor',
20 'capabilities' => [
21 'read',
22 'upload_files',
23 'edit_posts' // Required by WooCommerce for wp-admin access. Ideally instructors should only manage courses, not posts.
24 ],
25 'prefix_capabilities' => [
26 'publish',
27 'edit',
28 'delete',
29 'edit_published',
30 'delete_published',
31 'read_private',
32 'edit_private',
33 'delete_private',
34 ],
35 ],
36 );
37
38 $config[ UserModel::ROLE_ADMINISTRATOR ] = apply_filters(
39 'learn-press/role/admin/capabilities_default',
40 [
41 'label' => 'Administrator',
42 'prefix_capabilities' => array_merge(
43 $config[ UserModel::ROLE_INSTRUCTOR ]['prefix_capabilities'],
44 [
45 'edit_others',
46 'delete_others',
47 ]
48 ),
49 ]
50 );
51
52 return apply_filters( 'learn-press/roles/capabilities_default', $config );
53