PluginProbe ʕ •ᴥ•ʔ
Tutor LMS – eLearning and online course solution / 2.6.0
Tutor LMS – eLearning and online course solution v2.6.0
3.9.14 3.9.13 3.9.12 3.9.11 trunk 1.0.0 1.0.0-alpha 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.2.0 1.2.1 1.2.11 1.2.12 1.2.13 1.2.20 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8.0 1.8.1 1.8.10 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 1.9.1 1.9.10 1.9.11 1.9.12 1.9.13 1.9.14 1.9.15 1.9.16 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.10 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.10 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.3.0 2.4.0 2.5.0 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 3.0.0 3.0.1 3.0.2 3.1.0 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.8.0 3.8.1 3.8.2 3.8.3 3.9.0 3.9.1 3.9.10 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9
tutor / classes / Post_types.php
tutor / classes Last commit date
Addons.php 2 years ago Admin.php 2 years ago Ajax.php 2 years ago Announcements.php 3 years ago Assets.php 2 years ago Backend_Page_Trait.php 3 years ago Course.php 2 years ago Course_Embed.php 3 years ago Course_Filter.php 2 years ago Course_List.php 2 years ago Course_Settings_Tabs.php 3 years ago Course_Widget.php 3 years ago Custom_Validation.php 3 years ago Dashboard.php 3 years ago FormHandler.php 2 years ago Frontend.php 2 years ago Gutenberg.php 3 years ago Input.php 3 years ago Instructor.php 2 years ago Instructors_List.php 2 years ago Lesson.php 2 years ago Options_V2.php 2 years ago Permalink.php 2 years ago Post_types.php 2 years ago Private_Course_Access.php 3 years ago Q_and_A.php 3 years ago Question_Answers_List.php 3 years ago Quiz.php 2 years ago Quiz_Attempts_List.php 2 years ago RestAPI.php 3 years ago Reviews.php 3 years ago Rewrite_Rules.php 2 years ago Shortcode.php 2 years ago Student.php 2 years ago Students_List.php 3 years ago Taxonomies.php 3 years ago Template.php 2 years ago Theme_Compatibility.php 3 years ago Tools.php 3 years ago Tools_V2.php 3 years ago Tutor.php 2 years ago TutorEDD.php 2 years ago Tutor_Base.php 2 years ago Tutor_Setup.php 2 years ago Upgrader.php 2 years ago User.php 2 years ago Utils.php 2 years ago Video_Stream.php 3 years ago WhatsNew.php 2 years ago Withdraw.php 2 years ago Withdraw_Requests_List.php 3 years ago WooCommerce.php 2 years ago
Post_types.php
523 lines
1 <?php
2 /**
3 * Register post types
4 *
5 * @package Tutor\PostTypes
6 * @category PostTypes
7 * @author Themeum <support@themeum.com>
8 * @link https://themeum.com
9 * @since 1.0.0
10 */
11
12 namespace TUTOR;
13
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit;
16 }
17 /**
18 * Register Tutor's post types
19 *
20 * @since 1.0.0
21 */
22 //phpcs:ignore
23 class Post_types {
24
25 /**
26 * Course post type
27 *
28 * @since 1.0.0
29 *
30 * @var string
31 */
32 public $course_post_type;
33
34 /**
35 * Lesson post type
36 *
37 * @since 1.0.0
38 *
39 * @var string
40 */
41 public $lesson_post_type;
42
43 /**
44 * Register hooks
45 *
46 * @since 1.0.0
47 */
48 public function __construct() {
49 $this->course_post_type = tutor()->course_post_type;
50 $this->lesson_post_type = tutor()->lesson_post_type;
51
52 add_action( 'init', array( $this, 'register_course_post_types' ) );
53 add_action( 'init', array( $this, 'register_lesson_post_types' ) );
54 add_action( 'init', array( $this, 'register_quiz_post_types' ) );
55 add_action( 'init', array( $this, 'register_topic_post_types' ) );
56 add_action( 'init', array( $this, 'register_assignments_post_types' ) );
57
58 add_filter( 'gutenberg_can_edit_post_type', array( $this, 'gutenberg_can_edit_post_type' ), 10, 2 );
59 add_filter( 'use_block_editor_for_post_type', array( $this, 'gutenberg_can_edit_post_type' ), 10, 2 );
60
61 /**
62 * Customize the message of course
63 */
64 add_filter( 'post_updated_messages', array( $this, 'course_updated_messages' ) );
65
66 /**
67 * Since 1.4.0
68 */
69 add_action( 'init', array( $this, 'register_tutor_enrolled_post_types' ) );
70
71 /**
72 * Remove tutor course post type from admin menu
73 *
74 * @since v2.0.0
75 */
76 add_action( 'admin_menu', array( $this, 'remove_course_post_menu' ) );
77 }
78
79 /**
80 * Register course post type
81 *
82 * @since 1.0.0
83 *
84 * @return void
85 */
86 public function register_course_post_types() {
87 $course_post_type = $this->course_post_type;
88
89 $labels = array(
90 'name' => _x( 'Courses', 'post type general name', 'tutor' ),
91 'singular_name' => _x( 'Course', 'post type singular name', 'tutor' ),
92 'menu_name' => _x( 'Courses', 'admin menu', 'tutor' ),
93 'name_admin_bar' => _x( 'Course', 'add new on admin bar', 'tutor' ),
94 'add_new' => _x( 'Add New', 'tutor course add', 'tutor' ),
95 'add_new_item' => __( 'Add New Course', 'tutor' ),
96 'new_item' => __( 'New Course', 'tutor' ),
97 'edit_item' => __( 'Edit Course', 'tutor' ),
98 'view_item' => __( 'View Course', 'tutor' ),
99 'all_items' => __( 'Courses', 'tutor' ),
100 'search_items' => __( 'Search Courses', 'tutor' ),
101 'parent_item_colon' => __( 'Parent Courses:', 'tutor' ),
102 'not_found' => __( 'No courses found.', 'tutor' ),
103 'not_found_in_trash' => __( 'No courses found in Trash.', 'tutor' ),
104 );
105
106 $args = array(
107 'labels' => $labels,
108 'description' => __( 'Description.', 'tutor' ),
109 'public' => true,
110 'publicly_queryable' => true,
111 // 'show_ui' => true,
112 // 'show_in_menu' => 'tutor',
113 'query_var' => true,
114 'rewrite' => array(
115 'slug' => tutor_utils()->get_option( 'course_permalink_base', $course_post_type ),
116 'with_front' => true,
117 ),
118 'menu_icon' => 'dashicons-book-alt',
119 'capability_type' => 'post',
120 'has_archive' => true,
121 'hierarchical' => false,
122 'menu_position' => null,
123 'taxonomies' => array( 'course-category', 'course-tag' ),
124 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt', 'author' ),
125 'show_in_rest' => true,
126
127 'capabilities' => array(
128 'edit_post' => 'edit_tutor_course',
129 'read_post' => 'read_tutor_course',
130 'delete_post' => 'delete_tutor_course',
131 'delete_posts' => 'delete_tutor_courses',
132 'edit_posts' => 'edit_tutor_courses',
133 'edit_others_posts' => 'edit_others_tutor_courses',
134 'publish_posts' => 'publish_tutor_courses',
135 'read_private_posts' => 'read_private_tutor_courses',
136 'create_posts' => 'edit_tutor_courses',
137 ),
138 );
139
140 register_post_type( $course_post_type, $args );
141
142 /**
143 * Taxonomy
144 */
145 $labels = array(
146 'name' => _x( 'Course Categories', 'taxonomy general name', 'tutor' ),
147 'singular_name' => _x( 'Category', 'taxonomy singular name', 'tutor' ),
148 'search_items' => __( 'Search Categories', 'tutor' ),
149 'popular_items' => __( 'Popular Categories', 'tutor' ),
150 'all_items' => __( 'All Categories', 'tutor' ),
151 'parent_item' => null,
152 'parent_item_colon' => null,
153 'edit_item' => __( 'Edit Category', 'tutor' ),
154 'update_item' => __( 'Update Category', 'tutor' ),
155 'add_new_item' => __( 'Add New Category', 'tutor' ),
156 'new_item_name' => __( 'New Category Name', 'tutor' ),
157 'separate_items_with_commas' => __( 'Separate categories with commas', 'tutor' ),
158 'add_or_remove_items' => __( 'Add or remove categories', 'tutor' ),
159 'choose_from_most_used' => __( 'Choose from the most used categories', 'tutor' ),
160 'not_found' => __( 'No categories found.', 'tutor' ),
161 'menu_name' => __( 'Course Categories', 'tutor' ),
162 );
163
164 $args = array(
165 'hierarchical' => true,
166 'labels' => $labels,
167 'show_ui' => true,
168 'show_admin_column' => true,
169 'update_count_callback' => '_update_post_term_count',
170 'query_var' => true,
171 'show_in_rest' => true,
172 'rewrite' => array( 'slug' => 'course-category' ),
173 );
174
175 register_taxonomy( 'course-category', $this->course_post_type, $args );
176
177 $labels = array(
178 'name' => _x( 'Tags', 'taxonomy general name', 'tutor' ),
179 'singular_name' => _x( 'Tag', 'taxonomy singular name', 'tutor' ),
180 'search_items' => __( 'Search Tags', 'tutor' ),
181 'popular_items' => __( 'Popular Tags', 'tutor' ),
182 'all_items' => __( 'All Tags', 'tutor' ),
183 'parent_item' => null,
184 'parent_item_colon' => null,
185 'edit_item' => __( 'Edit Tag', 'tutor' ),
186 'update_item' => __( 'Update Tag', 'tutor' ),
187 'add_new_item' => __( 'Add New Tag', 'tutor' ),
188 'new_item_name' => __( 'New Tag Name', 'tutor' ),
189 'separate_items_with_commas' => __( 'Separate Tags with commas', 'tutor' ),
190 'add_or_remove_items' => __( 'Add or remove Tags', 'tutor' ),
191 'choose_from_most_used' => __( 'Choose from the most used Tags', 'tutor' ),
192 'not_found' => __( 'No Tags found.', 'tutor' ),
193 'menu_name' => __( 'Tags', 'tutor' ),
194 );
195
196 $args = array(
197 'hierarchical' => false,
198 'labels' => $labels,
199 'show_ui' => true,
200 'show_admin_column' => true,
201 'update_count_callback' => '_update_post_term_count',
202 'query_var' => true,
203 'show_in_rest' => true,
204 'rewrite' => array( 'slug' => 'course-tag' ),
205 );
206
207 register_taxonomy( 'course-tag', $this->course_post_type, $args );
208 }
209
210 /**
211 * Register lesson post type
212 *
213 * @since 1.0.0
214 *
215 * @return void
216 */
217 public function register_lesson_post_types() {
218 $lesson_post_type = $this->lesson_post_type;
219 $lesson_base_slug = apply_filters( 'tutor_lesson_base_slug', $lesson_post_type );
220
221 $labels = array(
222 'name' => _x( 'Lessons', 'post type general name', 'tutor' ),
223 'singular_name' => _x( 'Lesson', 'post type singular name', 'tutor' ),
224 'menu_name' => _x( 'Lessons', 'admin menu', 'tutor' ),
225 'name_admin_bar' => _x( 'Lesson', 'add new on admin bar', 'tutor' ),
226 'add_new' => _x( 'Add New', 'tutor lesson add', 'tutor' ),
227 'add_new_item' => __( 'Add New Lesson', 'tutor' ),
228 'new_item' => __( 'New Lesson', 'tutor' ),
229 'edit_item' => __( 'Edit Lesson', 'tutor' ),
230 'view_item' => __( 'View Lesson', 'tutor' ),
231 'all_items' => __( 'Lessons', 'tutor' ),
232 'search_items' => __( 'Search Lessons', 'tutor' ),
233 'parent_item_colon' => __( 'Parent Lessons:', 'tutor' ),
234 'not_found' => __( 'No lessons found.', 'tutor' ),
235 'not_found_in_trash' => __( 'No lessons found in Trash.', 'tutor' ),
236 );
237
238 $args = array(
239 'labels' => $labels,
240 'description' => __( 'Description.', 'tutor' ),
241 'public' => true,
242 'publicly_queryable' => true,
243 'show_ui' => true,
244 'show_in_menu' => false,
245 'query_var' => true,
246 'rewrite' => array( 'slug' => $lesson_base_slug ),
247 'menu_icon' => 'dashicons-list-view',
248 'capability_type' => 'post',
249 'has_archive' => true,
250 'hierarchical' => false,
251 'menu_position' => null,
252 'supports' => array( 'title', 'editor', 'comments' ),
253 'exclude_from_search' => apply_filters( 'tutor_lesson_exclude_from_search', true ),
254 'capabilities' => array(
255 'edit_post' => 'edit_tutor_lesson',
256 'read_post' => 'read_tutor_lesson',
257 'delete_post' => 'delete_tutor_lesson',
258 'delete_posts' => 'delete_tutor_lessons',
259 'edit_posts' => 'edit_tutor_lessons',
260 'edit_others_posts' => 'edit_others_tutor_lessons',
261 'publish_posts' => 'publish_tutor_lessons',
262 'read_private_posts' => 'read_private_tutor_lessons',
263 'create_posts' => 'edit_tutor_lessons',
264 ),
265 );
266
267 /**
268 * Added for support gutenberg editor to lesson post type
269 *
270 * @since 2.1.6
271 */
272 $enable_gutenberg = (bool) tutor_utils()->get_option( 'enable_gutenberg_course_edit' );
273 if ( $enable_gutenberg ) {
274 $args['show_in_rest'] = true;
275 }
276
277 register_post_type( $lesson_post_type, $args );
278 }
279
280 /**
281 * Register quiz post type
282 *
283 * @since 1.0.0
284 *
285 * @return void
286 */
287 public function register_quiz_post_types() {
288 $labels = array(
289 'name' => _x( 'Quizzes', 'post type general name', 'tutor' ),
290 'singular_name' => _x( 'Quiz', 'post type singular name', 'tutor' ),
291 'menu_name' => _x( 'Quizzes', 'admin menu', 'tutor' ),
292 'name_admin_bar' => _x( 'Quiz', 'add new on admin bar', 'tutor' ),
293 'add_new' => _x( 'Add New', 'tutor quiz add', 'tutor' ),
294 'add_new_item' => __( 'Add New Quiz', 'tutor' ),
295 'new_item' => __( 'New Quiz', 'tutor' ),
296 'edit_item' => __( 'Edit Quiz', 'tutor' ),
297 'view_item' => __( 'View Quiz', 'tutor' ),
298 'all_items' => __( 'Quizzes', 'tutor' ),
299 'search_items' => __( 'Search Quizzes', 'tutor' ),
300 'parent_item_colon' => __( 'Parent Quizzes:', 'tutor' ),
301 'not_found' => __( 'No quizzes found.', 'tutor' ),
302 'not_found_in_trash' => __( 'No quizzes found in Trash.', 'tutor' ),
303 );
304
305 $args = array(
306 'labels' => $labels,
307 'description' => __( 'Description.', 'tutor' ),
308 'public' => true,
309 'publicly_queryable' => true,
310 'show_ui' => false,
311 'show_in_menu' => 'tutor',
312 'query_var' => true,
313 'rewrite' => array( 'slug' => $this->lesson_post_type ),
314 'menu_icon' => 'dashicons-editor-help',
315 'capability_type' => 'post',
316 'has_archive' => true,
317 'hierarchical' => false,
318 'menu_position' => null,
319 'supports' => array( 'title', 'editor' ),
320 'exclude_from_search' => apply_filters( 'tutor_quiz_exclude_from_search', true ),
321 'capabilities' => array(
322 'edit_post' => 'edit_tutor_quiz',
323 'read_post' => 'read_tutor_quiz',
324 'delete_post' => 'delete_tutor_quiz',
325 'delete_posts' => 'delete_tutor_quizzes',
326 'edit_posts' => 'edit_tutor_quizzes',
327 'edit_others_posts' => 'edit_others_tutor_quizzes',
328 'publish_posts' => 'publish_tutor_quizzes',
329 'read_private_posts' => 'read_private_tutor_quizzes',
330 'create_posts' => 'edit_tutor_quizzes',
331 ),
332 );
333
334 register_post_type( 'tutor_quiz', $args );
335 }
336
337 /**
338 * Register topic post type
339 *
340 * @since 1.0.0
341 *
342 * @return void
343 */
344 public function register_topic_post_types() {
345 $args = array(
346 'label' => 'Topics',
347 'description' => __( 'Description.', 'tutor' ),
348 'public' => false,
349 'publicly_queryable' => false,
350 'show_ui' => false,
351 'query_var' => false,
352 'has_archive' => false,
353 'hierarchical' => false,
354 'menu_position' => null,
355 );
356 register_post_type( 'topics', $args );
357 }
358
359 /**
360 * Register assignment post type
361 *
362 * @since 1.0.0
363 *
364 * @return void
365 */
366 public function register_assignments_post_types() {
367 $labels = array(
368 'name' => _x( 'Assignments', 'post type general name', 'tutor' ),
369 'singular_name' => _x( 'Assignment', 'post type singular name', 'tutor' ),
370 'menu_name' => _x( 'Assignments', 'admin menu', 'tutor' ),
371 'name_admin_bar' => _x( 'Assignment', 'add new on admin bar', 'tutor' ),
372 'add_new' => _x( 'Add New', 'tutor assignment add', 'tutor' ),
373 'add_new_item' => __( 'Add New Assignment', 'tutor' ),
374 'new_item' => __( 'New Assignment', 'tutor' ),
375 'edit_item' => __( 'Edit Assignment', 'tutor' ),
376 'view_item' => __( 'View Assignment', 'tutor' ),
377 'all_items' => __( 'Assignments', 'tutor' ),
378 'search_items' => __( 'Search Assignments', 'tutor' ),
379 'parent_item_colon' => __( 'Parent Assignments:', 'tutor' ),
380 'not_found' => __( 'No Assignments found.', 'tutor' ),
381 'not_found_in_trash' => __( 'No Assignments found in Trash.', 'tutor' ),
382 );
383
384 $args = array(
385 'labels' => $labels,
386 'description' => __( 'Description.', 'tutor' ),
387 'public' => true,
388 'publicly_queryable' => true,
389 'show_ui' => false,
390 'show_in_menu' => 'tutor',
391 'query_var' => true,
392 'rewrite' => array( 'slug' => $this->lesson_post_type ),
393 'menu_icon' => 'dashicons-editor-help',
394 'capability_type' => 'post',
395 'has_archive' => true,
396 'hierarchical' => false,
397 'menu_position' => null,
398 'supports' => array( 'title', 'editor' ),
399 'exclude_from_search' => apply_filters( 'tutor_assignment_exclude_from_search', true ),
400 'capabilities' => array(
401 'edit_post' => 'edit_tutor_assignment',
402 'read_post' => 'read_tutor_assignment',
403 'delete_post' => 'delete_tutor_assignment',
404 'delete_posts' => 'delete_tutor_assignments',
405 'edit_posts' => 'edit_tutor_assignments',
406 'edit_others_posts' => 'edit_others_tutor_assignments',
407 'publish_posts' => 'publish_tutor_assignments',
408 'read_private_posts' => 'read_private_tutor_assignments',
409 'create_posts' => 'edit_tutor_assignments',
410 ),
411 );
412
413 register_post_type( 'tutor_assignments', $args );
414 }
415
416 /**
417 * Course update messages
418 *
419 * @since 1.0.0
420 *
421 * @param array $messages messages.
422 *
423 * @return mixed
424 */
425 public function course_updated_messages( $messages ) {
426 $post = get_post();
427 $post_type = get_post_type( $post );
428 $post_type_object = get_post_type_object( $post_type );
429
430 $course_post_type = tutor()->course_post_type;
431
432 $revision = Input::get( 'revision' );
433 $revision_msg = __( 'Course restored to revision from ', 'tutor' );
434 if ( ! is_null( $revision ) ) {
435 $revision_msg .= wp_post_revision_title( $revision );
436 } else {
437 $revision_msg = false;
438 }
439
440 $schedule_date = date_i18n( __( 'M j, Y @ G:i', 'tutor' ), strtotime( $post->post_date ) );
441 $schedule_msg = __( 'Course scheduled for:', 'tutor' );
442 $schedule_msg .= ' <strong> ' . $schedule_date . ' </strong>';
443
444 $messages[ $course_post_type ] = array(
445 0 => '', // Unused. Messages start at index 1.
446 1 => __( 'Course updated.', 'tutor' ),
447 2 => __( 'Custom field updated.', 'tutor' ),
448 3 => __( 'Custom field deleted.', 'tutor' ),
449 4 => __( 'Course updated.', 'tutor' ),
450 5 => $revision_msg,
451 6 => __( 'Course published.', 'tutor' ),
452 7 => __( 'Course saved.', 'tutor' ),
453 8 => __( 'Course submitted.', 'tutor' ),
454 9 => $schedule_msg,
455 10 => __( 'Course draft updated.', 'tutor' ),
456 );
457
458 if ( $post_type_object->publicly_queryable && $course_post_type === $post_type ) {
459 $permalink = get_permalink( $post->ID );
460
461 $view_link = sprintf( ' <a href="%s">%s</a>', esc_url( $permalink ), __( 'View course', 'tutor' ) );
462 $messages[ $post_type ][1] .= $view_link;
463 $messages[ $post_type ][6] .= $view_link;
464 $messages[ $post_type ][9] .= $view_link;
465
466 $preview_permalink = add_query_arg( 'preview', 'true', $permalink );
467 $preview_link = sprintf( ' <a target="_blank" href="%s">%s</a>', esc_url( $preview_permalink ), __( 'Preview course', 'tutor' ) );
468 $messages[ $post_type ][8] .= $preview_link;
469 $messages[ $post_type ][10] .= $preview_link;
470 }
471
472 return $messages;
473 }
474
475 /**
476 * Gutenberg can edit post filter handler
477 *
478 * @since 1.0.0
479 *
480 * @param bool $can_edit use block editor.
481 * @param string $post_type post type.
482 *
483 * @return bool
484 *
485 * Enable / Disable Gutenberg Editor
486 * @since v.1.3.4
487 */
488 public function gutenberg_can_edit_post_type( $can_edit, $post_type ) {
489 $enable_gutenberg = (bool) tutor_utils()->get_option( 'enable_gutenberg_course_edit' );
490 return $this->course_post_type === $post_type ? $enable_gutenberg : $can_edit;
491 }
492
493 /**
494 * Register tutor_enrolled post type
495 *
496 * @since v.1.4.0
497 */
498 public function register_tutor_enrolled_post_types() {
499 $args = array(
500 'label' => 'Tutor Enrolled',
501 'description' => __( 'Description.', 'tutor' ),
502 'public' => false,
503 'publicly_queryable' => false,
504 'show_ui' => false,
505 'query_var' => false,
506 'has_archive' => false,
507 'hierarchical' => false,
508 'menu_position' => null,
509 );
510 register_post_type( 'tutor_enrolled', $args );
511 }
512
513 /**
514 * Remove course post menu
515 *
516 * @return void
517 * @since v2.0.0
518 */
519 public function remove_course_post_menu() {
520 remove_menu_page( 'edit.php?post_type=' . tutor()->course_post_type );
521 }
522 }
523