PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.9
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.9
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 4.1.7.3.2 All 140 releases
learnpress / config / wp-menus.php

wp-menus.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.4.9, at config/wp-menus.php

140 lines 4.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * LearnPress admin submenu definitions.
4 *
5 * @package LearnPress
6 * @version 1.0.0
7 * @since 4.4.5
8 */
9
10 use LearnPress\TemplateHooks\Admin\AdminAddonsPage;
11 use LearnPress\TemplateHooks\Admin\AdminListStudentsEnrolled;
12 use LearnPress\TemplateHooks\Admin\AdminSettingsPage;
13 use LearnPress\TemplateHooks\Admin\AdminStatisticsReportTable;
14 use LearnPress\TemplateHooks\Admin\AdminToolsPage;
15
16 defined( 'ABSPATH' ) || exit;
17
18 $menu_items = apply_filters(
19 'learn-press/wp-menus',
20 [
21 // Statistics - tabbed page.
22 'statistic' => [
23 'id' => 'learn-press-statistics',
24 'menu_title' => __( 'Statistics', 'learnpress' ),
25 'page_title' => __( 'Statistics', 'learnpress' ),
26 'capability' => 'manage_options',
27 'priority' => 10,
28 'callback' => [ AdminStatisticsReportTable::instance(), 'html_statistics' ],
29 ],
30 // Students.
31 'student-enrolled' => [
32 'id' => 'learn-press-students-enrolled',
33 'menu_title' => __( 'Students', 'learnpress' ),
34 'page_title' => __( 'Students', 'learnpress' ),
35 'capability' => 'edit_' . LP_COURSE_CPT . 's',
36 'priority' => 20,
37 'callback' => [ AdminListStudentsEnrolled::instance(), 'admin_page_output' ],
38 ],
39 // Add-ons.
40 'addons' => [
41 'id' => 'learn-press-addons',
42 'menu_title' => sprintf(
43 '%s<span class="lp-menu-addons update-plugins lp-hidden"></span>',
44 __( 'Add-ons', 'learnpress' )
45 ),
46 'page_title' => __( 'LearnPress Add-ons', 'learnpress' ),
47 'capability' => 'manage_options',
48 'priority' => 20,
49 'callback' => [ AdminAddonsPage::instance(), 'html_page' ],
50 ],
51 // Settings.
52 'settings' => [
53 'id' => 'learn-press-settings',
54 'menu_title' => esc_html__( 'Settings', 'learnpress' ),
55 'page_title' => esc_html__( 'LearnPress Settings', 'learnpress' ),
56 'capability' => 'manage_options',
57 'priority' => 30,
58 'callback' => [ AdminSettingsPage::instance(), 'html_page' ],
59 ],
60 // Help Center.
61 'help-center' => [
62 'id' => 'learn-press-help-center',
63 'menu_title' => __( 'Help Center', 'learnpress' ),
64 'page_title' => __( 'LearnPress Help Center', 'learnpress' ),
65 'capability' => 'manage_options',
66 'priority' => 25,
67 'callback' => function () {
68 learn_press_admin_view( 'help-center/html-help-center' );
69 },
70 ],
71 'themes' => [
72 'id' => 'learn-press-themes',
73 'menu_title' => __( 'Themes', 'learnpress' ),
74 'page_title' => __( 'LearnPress Themes', 'learnpress' ),
75 'capability' => 'manage_options',
76 'priority' => 25,
77 'callback' => function () {
78 learn_press_admin_view( 'themes/html-themes' );
79 },
80 ],
81 // Tools.
82 'tools' => [
83 'id' => 'learn-press-tools',
84 'menu_title' => __( 'Tools', 'learnpress' ),
85 'page_title' => __( 'LearnPress Tools', 'learnpress' ),
86 'capability' => 'manage_options',
87 'priority' => 40,
88 'callback' => [ AdminToolsPage::instance(), 'html_page' ],
89 ],
90 // Taxonomy sub-menus - no callback, only the URL as the slug.
91 'categories' => [
92 'id' => 'edit-tags.php?taxonomy=course_category',
93 'menu_title' => __( 'Categories', 'learnpress' ),
94 'page_title' => __( 'Categories', 'learnpress' ),
95 'capability' => 'manage_options',
96 'priority' => 1,
97 'callback' => false,
98 ],
99 'tags' => [
100 'id' => 'edit-tags.php?taxonomy=course_tag',
101 'menu_title' => __( 'Tags', 'learnpress' ),
102 'page_title' => __( 'Tags', 'learnpress' ),
103 'capability' => 'manage_options',
104 'priority' => 2,
105 'callback' => false,
106 ],
107 ]
108 );
109
110 $group_menus = apply_filters(
111 'learn-press/wp-admin/menu-group',
112 [
113 'content' => [
114 'courses' => 'edit.php?post_type=' . LP_COURSE_CPT,
115 'lessons' => 'edit.php?post_type=' . LP_LESSON_CPT,
116 'quizzes' => 'edit.php?post_type=' . LP_QUIZ_CPT,
117 'questions' => 'edit.php?post_type=' . LP_QUESTION_CPT,
118 'course_category' => 'edit-tags.php?taxonomy=course_category',
119 'course_tag' => 'edit-tags.php?taxonomy=course_tag',
120 ],
121 'operations' => [
122 'orders' => 'edit.php?post_type=' . LP_ORDER_CPT,
123 'students' => 'learn-press-students-enrolled',
124 'statistics' => 'learn-press-statistics',
125 ],
126 'system' => [
127 'addons' => 'learn-press-addons',
128 'themes' => 'learn-press-themes',
129 'settings' => 'learn-press-settings',
130 'tools' => 'learn-press-tools',
131 'help_center' => 'learn-press-help-center',
132 ],
133 ]
134 );
135
136 return [
137 'menus' => $menu_items,
138 'group_menus' => $group_menus,
139 ];
140