PluginProbe ʕ •ᴥ•ʔ
Tutor LMS – eLearning and online course solution / 2.1.6
Tutor LMS – eLearning and online course solution v2.1.6
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 3 years ago Admin.php 3 years ago Ajax.php 3 years ago Announcements.php 3 years ago Assets.php 3 years ago Backend_Page_Trait.php 3 years ago Course.php 3 years ago Course_Embed.php 3 years ago Course_Filter.php 3 years ago Course_List.php 3 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 3 years ago Frontend.php 3 years ago Gutenberg.php 3 years ago Input.php 3 years ago Instructor.php 3 years ago Instructors_List.php 3 years ago Lesson.php 3 years ago Options_V2.php 3 years ago Post_types.php 3 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 3 years ago Quiz_Attempts_List.php 3 years ago RestAPI.php 3 years ago Reviews.php 3 years ago Rewrite_Rules.php 3 years ago Shortcode.php 3 years ago Student.php 3 years ago Students_List.php 3 years ago Taxonomies.php 3 years ago Template.php 3 years ago Theme_Compatibility.php 3 years ago Tools.php 3 years ago Tools_V2.php 3 years ago Tutor.php 3 years ago TutorEDD.php 3 years ago Tutor_Base.php 3 years ago Tutor_Setup.php 3 years ago Upgrader.php 3 years ago User.php 3 years ago Utils.php 3 years ago Video_Stream.php 3 years ago Withdraw.php 3 years ago Withdraw_Requests_List.php 3 years ago WooCommerce.php 3 years ago
Post_types.php
522 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 class Post_types {
23
24 /**
25 * Course post type
26 *
27 * @since 1.0.0
28 *
29 * @var string
30 */
31 public $course_post_type;
32
33 /**
34 * Lesson post type
35 *
36 * @since 1.0.0
37 *
38 * @var string
39 */
40 public $lesson_post_type;
41
42 /**
43 * Register hooks
44 *
45 * @since 1.0.0
46 */
47 public function __construct() {
48 $this->course_post_type = tutor()->course_post_type;
49 $this->lesson_post_type = tutor()->lesson_post_type;
50
51 add_action( 'init', array( $this, 'register_course_post_types' ) );
52 add_action( 'init', array( $this, 'register_lesson_post_types' ) );
53 add_action( 'init', array( $this, 'register_quiz_post_types' ) );
54 add_action( 'init', array( $this, 'register_topic_post_types' ) );
55 add_action( 'init', array( $this, 'register_assignments_post_types' ) );
56
57 add_filter( 'gutenberg_can_edit_post_type', array( $this, 'gutenberg_can_edit_post_type' ), 10, 2 );
58 add_filter( 'use_block_editor_for_post_type', array( $this, 'gutenberg_can_edit_post_type' ), 10, 2 );
59
60 /**
61 * Customize the message of course
62 */
63 add_filter( 'post_updated_messages', array( $this, 'course_updated_messages' ) );
64
65 /**
66 * Since 1.4.0
67 */
68 add_action( 'init', array( $this, 'register_tutor_enrolled_post_types' ) );
69
70 /**
71 * Remove tutor course post type from admin menu
72 *
73 * @since v2.0.0
74 */
75 add_action( 'admin_menu', array( $this, 'remove_course_post_menu' ) );
76 }
77
78 /**
79 * Register course post type
80 *
81 * @since 1.0.0
82 *
83 * @return void
84 */
85 public function register_course_post_types() {
86 $course_post_type = $this->course_post_type;
87 $courses_base_slug = apply_filters( 'tutor_courses_base_slug', $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', tutor()->course_post_type ),
116 'with_front' => false,
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 * @since 2.1.6
270 */
271 $enable_gutenberg = (bool) tutor_utils()->get_option( 'enable_gutenberg_course_edit' );
272 if ( $enable_gutenberg ) {
273 $args['show_in_rest'] = true;
274 }
275
276 register_post_type( $lesson_post_type, $args );
277 }
278
279 /**
280 * Register quiz post type
281 *
282 * @since 1.0.0
283 *
284 * @return void
285 */
286 public function register_quiz_post_types() {
287 $labels = array(
288 'name' => _x( 'Quizzes', 'post type general name', 'tutor' ),
289 'singular_name' => _x( 'Quiz', 'post type singular name', 'tutor' ),
290 'menu_name' => _x( 'Quizzes', 'admin menu', 'tutor' ),
291 'name_admin_bar' => _x( 'Quiz', 'add new on admin bar', 'tutor' ),
292 'add_new' => _x( 'Add New', 'tutor quiz add', 'tutor' ),
293 'add_new_item' => __( 'Add New Quiz', 'tutor' ),
294 'new_item' => __( 'New Quiz', 'tutor' ),
295 'edit_item' => __( 'Edit Quiz', 'tutor' ),
296 'view_item' => __( 'View Quiz', 'tutor' ),
297 'all_items' => __( 'Quizzes', 'tutor' ),
298 'search_items' => __( 'Search Quizzes', 'tutor' ),
299 'parent_item_colon' => __( 'Parent Quizzes:', 'tutor' ),
300 'not_found' => __( 'No quizzes found.', 'tutor' ),
301 'not_found_in_trash' => __( 'No quizzes found in Trash.', 'tutor' ),
302 );
303
304 $args = array(
305 'labels' => $labels,
306 'description' => __( 'Description.', 'tutor' ),
307 'public' => true,
308 'publicly_queryable' => true,
309 'show_ui' => false,
310 'show_in_menu' => 'tutor',
311 'query_var' => true,
312 'rewrite' => array( 'slug' => $this->lesson_post_type ),
313 'menu_icon' => 'dashicons-editor-help',
314 'capability_type' => 'post',
315 'has_archive' => true,
316 'hierarchical' => false,
317 'menu_position' => null,
318 'supports' => array( 'title', 'editor' ),
319 'exclude_from_search' => apply_filters( 'tutor_quiz_exclude_from_search', true ),
320 'capabilities' => array(
321 'edit_post' => 'edit_tutor_quiz',
322 'read_post' => 'read_tutor_quiz',
323 'delete_post' => 'delete_tutor_quiz',
324 'delete_posts' => 'delete_tutor_quizzes',
325 'edit_posts' => 'edit_tutor_quizzes',
326 'edit_others_posts' => 'edit_others_tutor_quizzes',
327 'publish_posts' => 'publish_tutor_quizzes',
328 'read_private_posts' => 'read_private_tutor_quizzes',
329 'create_posts' => 'edit_tutor_quizzes',
330 ),
331 );
332
333 register_post_type( 'tutor_quiz', $args );
334 }
335
336 /**
337 * Register topic post type
338 *
339 * @since 1.0.0
340 *
341 * @return void
342 */
343 public function register_topic_post_types() {
344 $args = array(
345 'label' => 'Topics',
346 'description' => __( 'Description.', 'tutor' ),
347 'public' => false,
348 'publicly_queryable' => false,
349 'show_ui' => false,
350 'query_var' => false,
351 'has_archive' => false,
352 'hierarchical' => false,
353 'menu_position' => null,
354 );
355 register_post_type( 'topics', $args );
356 }
357
358 /**
359 * Register assignment post type
360 *
361 * @since 1.0.0
362 *
363 * @return void
364 */
365 public function register_assignments_post_types() {
366 $labels = array(
367 'name' => _x( 'Assignments', 'post type general name', 'tutor' ),
368 'singular_name' => _x( 'Assignment', 'post type singular name', 'tutor' ),
369 'menu_name' => _x( 'Assignments', 'admin menu', 'tutor' ),
370 'name_admin_bar' => _x( 'Assignment', 'add new on admin bar', 'tutor' ),
371 'add_new' => _x( 'Add New', 'tutor assignment add', 'tutor' ),
372 'add_new_item' => __( 'Add New Assignment', 'tutor' ),
373 'new_item' => __( 'New Assignment', 'tutor' ),
374 'edit_item' => __( 'Edit Assignment', 'tutor' ),
375 'view_item' => __( 'View Assignment', 'tutor' ),
376 'all_items' => __( 'Assignments', 'tutor' ),
377 'search_items' => __( 'Search Assignments', 'tutor' ),
378 'parent_item_colon' => __( 'Parent Assignments:', 'tutor' ),
379 'not_found' => __( 'No Assignments found.', 'tutor' ),
380 'not_found_in_trash' => __( 'No Assignments found in Trash.', 'tutor' ),
381 );
382
383 $args = array(
384 'labels' => $labels,
385 'description' => __( 'Description.', 'tutor' ),
386 'public' => true,
387 'publicly_queryable' => true,
388 'show_ui' => false,
389 'show_in_menu' => 'tutor',
390 'query_var' => true,
391 'rewrite' => array( 'slug' => $this->lesson_post_type ),
392 'menu_icon' => 'dashicons-editor-help',
393 'capability_type' => 'post',
394 'has_archive' => true,
395 'hierarchical' => false,
396 'menu_position' => null,
397 'supports' => array( 'title', 'editor' ),
398 'exclude_from_search' => apply_filters( 'tutor_assignment_exclude_from_search', true ),
399 'capabilities' => array(
400 'edit_post' => 'edit_tutor_assignment',
401 'read_post' => 'read_tutor_assignment',
402 'delete_post' => 'delete_tutor_assignment',
403 'delete_posts' => 'delete_tutor_assignments',
404 'edit_posts' => 'edit_tutor_assignments',
405 'edit_others_posts' => 'edit_others_tutor_assignments',
406 'publish_posts' => 'publish_tutor_assignments',
407 'read_private_posts' => 'read_private_tutor_assignments',
408 'create_posts' => 'edit_tutor_assignments',
409 ),
410 );
411
412 register_post_type( 'tutor_assignments', $args );
413 }
414
415 /**
416 * Course update messages
417 *
418 * @since 1.0.0
419 *
420 * @param array $messages messages.
421 *
422 * @return mixed
423 */
424 public function course_updated_messages( $messages ) {
425 $post = get_post();
426 $post_type = get_post_type( $post );
427 $post_type_object = get_post_type_object( $post_type );
428
429 $course_post_type = tutor()->course_post_type;
430
431 $revision = Input::get( 'revision' );
432 $revision_msg = __( 'Course restored to revision from ', 'tutor' );
433 if ( ! is_null( $revision ) ) {
434 $revision_msg .= wp_post_revision_title( $revision );
435 } else {
436 $revision_msg = false;
437 }
438
439 $schedule_date = date_i18n( __( 'M j, Y @ G:i', 'tutor' ), strtotime( $post->post_date ) );
440 $schedule_msg = __( 'Course scheduled for:', 'tutor' );
441 $schedule_msg .= ' <strong> ' . $schedule_date . ' </strong>';
442
443 $messages[ $course_post_type ] = array(
444 0 => '', // Unused. Messages start at index 1.
445 1 => __( 'Course updated.', 'tutor' ),
446 2 => __( 'Custom field updated.', 'tutor' ),
447 3 => __( 'Custom field deleted.', 'tutor' ),
448 4 => __( 'Course updated.', 'tutor' ),
449 5 => $revision_msg,
450 6 => __( 'Course published.', 'tutor' ),
451 7 => __( 'Course saved.', 'tutor' ),
452 8 => __( 'Course submitted.', 'tutor' ),
453 9 => $schedule_msg,
454 10 => __( 'Course draft updated.', 'tutor' ),
455 );
456
457 if ( $post_type_object->publicly_queryable && $course_post_type === $post_type ) {
458 $permalink = get_permalink( $post->ID );
459
460 $view_link = sprintf( ' <a href="%s">%s</a>', esc_url( $permalink ), __( 'View course', 'tutor' ) );
461 $messages[ $post_type ][1] .= $view_link;
462 $messages[ $post_type ][6] .= $view_link;
463 $messages[ $post_type ][9] .= $view_link;
464
465 $preview_permalink = add_query_arg( 'preview', 'true', $permalink );
466 $preview_link = sprintf( ' <a target="_blank" href="%s">%s</a>', esc_url( $preview_permalink ), __( 'Preview course', 'tutor' ) );
467 $messages[ $post_type ][8] .= $preview_link;
468 $messages[ $post_type ][10] .= $preview_link;
469 }
470
471 return $messages;
472 }
473
474 /**
475 * Gutenberg can edit post filter handler
476 *
477 * @since 1.0.0
478 *
479 * @param bool $can_edit use block editor.
480 * @param string $post_type post type.
481 *
482 * @return bool
483 *
484 * Enable / Disable Gutenberg Editor
485 * @since v.1.3.4
486 */
487 public function gutenberg_can_edit_post_type( $can_edit, $post_type ) {
488 $enable_gutenberg = (bool) tutor_utils()->get_option( 'enable_gutenberg_course_edit' );
489 return $this->course_post_type === $post_type ? $enable_gutenberg : $can_edit;
490 }
491
492 /**
493 * Register tutor_enrolled post type
494 *
495 * @since v.1.4.0
496 */
497 public function register_tutor_enrolled_post_types() {
498 $args = array(
499 'label' => 'Tutor Enrolled',
500 'description' => __( 'Description.', 'tutor' ),
501 'public' => false,
502 'publicly_queryable' => false,
503 'show_ui' => false,
504 'query_var' => false,
505 'has_archive' => false,
506 'hierarchical' => false,
507 'menu_position' => null,
508 );
509 register_post_type( 'tutor_enrolled', $args );
510 }
511
512 /**
513 * Remove course post menu
514 *
515 * @return void
516 * @since v2.0.0
517 */
518 public function remove_course_post_menu() {
519 remove_menu_page( 'edit.php?post_type=' . tutor()->course_post_type );
520 }
521 }
522