PluginProbe ʕ •ᴥ•ʔ
Tutor LMS – eLearning and online course solution / 1.4.1
Tutor LMS – eLearning and online course solution v1.4.1
4.0.0 3.9.15 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 / Tutor.php
tutor / classes Last commit date
Addons.php 6 years ago Admin.php 6 years ago Ajax.php 6 years ago Assets.php 6 years ago Course.php 6 years ago Course_Settings_Tabs.php 6 years ago Course_Widget.php 6 years ago Dashboard.php 6 years ago Gutenberg.php 6 years ago Instructor.php 6 years ago Instructors_List.php 6 years ago Lesson.php 6 years ago Options.php 6 years ago Post_types.php 6 years ago Q_and_A.php 6 years ago Question.php 6 years ago Question_Answers_List.php 6 years ago Quiz.php 6 years ago Quiz_Attempts_List.php 6 years ago Rewrite_Rules.php 6 years ago Shortcode.php 6 years ago Student.php 6 years ago Students_List.php 6 years ago Taxonomies.php 6 years ago Template.php 6 years ago Theme_Compatibility.php 6 years ago Tools.php 6 years ago Tutor.php 6 years ago TutorEDD.php 6 years ago Tutor_Base.php 6 years ago Tutor_List_Table.php 6 years ago Upgrader.php 6 years ago User.php 6 years ago Utils.php 6 years ago Video_Stream.php 6 years ago Withdraw.php 6 years ago Withdraw_Requests_List.php 6 years ago WooCommerce.php 6 years ago
Tutor.php
616 lines
1 <?php
2 namespace TUTOR;
3
4 if ( ! defined( 'ABSPATH' ) )
5 exit;
6
7 final class Tutor{
8 public $version = TUTOR_VERSION;
9 public $path;
10 public $url;
11 public $basename;
12
13 /**
14 * The single instance of the class.
15 *
16 * @since v.1.2.0
17 */
18 protected static $_instance = null;
19
20 //Components
21 public $utils;
22 public $admin;
23 public $ajax;
24 public $options;
25 public $shortcode;
26
27 private $addons;
28 private $post_types;
29 private $taxonomies;
30 private $assets;
31 private $course;
32 private $lesson;
33 private $rewrite_rules;
34 private $template;
35 private $instructor;
36 private $student;
37 private $q_and_a;
38 private $quiz;
39 private $question;
40 private $tools;
41 private $user;
42 private $theme_compatibility;
43 private $gutenberg;
44 private $course_settings_tabs;
45
46 private $woocommerce;
47 private $edd;
48 private $withdraw;
49
50 private $course_widget;
51 private $upgrader;
52 private $dashboard;
53
54 /**
55 * @return null|Tutor
56 *
57 * Run the TUTOR
58 *
59 * @since 1.2.0
60 */
61 public static function instance() {
62 if ( is_null( self::$_instance ) ) {
63 self::$_instance = new self();
64 }
65 return self::$_instance;
66 }
67
68 function __construct() {
69
70 $this->path = plugin_dir_path(TUTOR_FILE);
71 $this->url = plugin_dir_url(TUTOR_FILE);
72 $this->basename = plugin_basename(TUTOR_FILE);
73
74 add_filter('wp_doing_ajax', array($this, 'wp_doing_ajax'));
75
76 /**
77 * Include Files
78 */
79 //add_action( 'init', array( $this, 'includes' ), 11 );
80 $this->includes();
81
82 /**
83 * Loading Autoloader
84 */
85
86 if ( function_exists( '__autoload' ) ) {
87 spl_autoload_register( '__autoload' );
88 }
89 spl_autoload_register(array($this, 'loader'));
90
91 do_action('tutor_before_load');
92
93 $this->addons = new Addons();
94 $this->post_types = new Post_types();
95 $this->taxonomies = new Taxonomies();
96 $this->assets = new Assets();
97 $this->admin = new Admin();
98 $this->ajax = new Ajax();
99 $this->options = new Options();
100 $this->shortcode = new Shortcode();
101 $this->course = new Course();
102 $this->lesson = new Lesson();
103 $this->rewrite_rules = new Rewrite_Rules();
104 $this->template = new Template();
105 $this->instructor = new Instructor();
106 $this->student = new Student();
107 $this->q_and_a = new Q_and_A();
108 $this->quiz = new Quiz();
109 $this->question = new Question();
110 $this->tools = new Tools();
111 $this->user = new User();
112 $this->theme_compatibility = new Theme_Compatibility();
113 $this->gutenberg = new Gutenberg();
114 $this->course_settings_tabs = new Course_Settings_Tabs();
115 $this->woocommerce = new WooCommerce();
116 $this->edd = new TutorEDD();
117 $this->withdraw = new Withdraw();
118 $this->course_widget = new Course_Widget();
119 $this->upgrader = new Upgrader();
120 $this->dashboard = new Dashboard();
121
122 /**
123 * Run Method
124 * @since v.1.2.0
125 */
126 $this->run();
127
128 do_action('tutor_loaded');
129
130 add_action( 'init', array( $this, 'init_action' ) );
131 }
132
133 /**
134 * @param $className
135 *
136 * Auto Load class and the files
137 */
138 private function loader($className) {
139 if ( ! class_exists($className)){
140 $className = preg_replace(
141 array('/([a-z])([A-Z])/', '/\\\/'),
142 array('$1$2', DIRECTORY_SEPARATOR),
143 $className
144 );
145
146 $className = str_replace('TUTOR'.DIRECTORY_SEPARATOR, 'classes'.DIRECTORY_SEPARATOR, $className);
147 $file_name = $this->path.$className.'.php';
148
149 if (file_exists($file_name) ) {
150 require_once $file_name;
151 }
152 }
153 }
154
155 public function includes(){
156 include tutor()->path.'includes/tutor-general-functions.php';
157 include tutor()->path.'includes/tutor-template-functions.php';
158 include tutor()->path.'includes/tutor-template-hook.php';
159 }
160
161 //Run the TUTOR right now
162 public function run(){
163 do_action('tutor_before_run');
164
165 register_activation_hook( TUTOR_FILE, array($this, 'tutor_activate' ) );
166 register_deactivation_hook(TUTOR_FILE, array($this, 'tutor_deactivation'));
167
168 do_action('tutor_after_run');
169 }
170
171 /**
172 * Tutor Action Via do_action
173 * @since 1.2.14
174 */
175 public function init_action(){
176 if (isset($_REQUEST['tutor_action'])){
177 do_action('tutor_action_'.$_REQUEST['tutor_action']);
178 }
179
180 }
181
182 /**
183 * Do some task during plugin activation
184 */
185 public function tutor_activate(){
186 $version = get_option('tutor_version');
187 //Save Option
188 if ( ! $version){
189 //Create Database
190 $this->create_database();
191
192 $options = self::default_options();
193 update_option('tutor_option', $options);
194
195 //Rewrite Flush
196 update_option('required_rewrite_flush', time());
197 self::manage_tutor_roles_and_permissions();
198
199 self::save_data();//Save initial Page
200 update_option('tutor_version', TUTOR_VERSION);
201 }
202
203 //Set Schedule
204 if (! wp_next_scheduled ( 'tutor_once_in_day_run_schedule' )) {
205 wp_schedule_event(time(), 'twicedaily', 'tutor_once_in_day_run_schedule');
206 }
207
208 /**
209 * Backward Compatibility for version < 1.2.0
210 */
211 if (version_compare(get_option('tutor_version'), '1.2.0', '<')){
212 /**
213 * Creating New Database
214 */
215 $this->create_withdraw_database();
216 //Update the tutor version
217 update_option('tutor_version', '1.2.0');
218 //Rewrite Flush
219 update_option('required_rewrite_flush', time());
220 }
221
222 /**
223 * Backward Compatibility to < 1.3.1 for make course plural
224 */
225 if (version_compare(get_option('tutor_version'), '1.3.1', '<')){
226 global $wpdb;
227
228 if ( ! get_option('is_course_post_type_updated')){
229 $wpdb->update($wpdb->posts, array('post_type' => 'courses'), array('post_type' => 'course'));
230 update_option('is_course_post_type_updated', true);
231 update_option('tutor_version', '1.3.1');
232 flush_rewrite_rules();
233 }
234 }
235
236 /**
237 * Save First activation Time
238 */
239 $first_activation_date = get_option('tutor_first_activation_time');
240 if ( ! $first_activation_date){
241 update_option('tutor_first_activation_time', time());
242 }
243
244 }
245
246 //Run task on deactivation
247 public function tutor_deactivation() {
248 wp_clear_scheduled_hook('tutor_once_in_day_run_schedule');
249 }
250
251 public function create_database(){
252 global $wpdb;
253
254 $charset_collate = $wpdb->get_charset_collate();
255
256 /**
257 * Table SQL
258 *
259 * {$wpdb->prefix}tutor_quiz_attempts
260 * {$wpdb->prefix}tutor_quiz_attempt_answers
261 * {$wpdb->prefix}tutor_quiz_questions
262 * {$wpdb->prefix}tutor_quiz_question_answers
263 * {$wpdb->prefix}tutor_earnings
264 * {$wpdb->prefix}tutor_withdraws
265 *
266 * @since v.1.0.0
267 */
268 $quiz_attempts_sql = "CREATE TABLE {$wpdb->prefix}tutor_quiz_attempts (
269 attempt_id int(11) NOT NULL AUTO_INCREMENT,
270 course_id int(11) DEFAULT NULL,
271 quiz_id int(11) DEFAULT NULL,
272 user_id int(11) DEFAULT NULL,
273 total_questions int(11) DEFAULT NULL,
274 total_answered_questions int(11) DEFAULT NULL,
275 total_marks decimal(9,2) DEFAULT NULL,
276 earned_marks decimal(9,2) DEFAULT NULL,
277 attempt_info text,
278 attempt_status varchar(50) DEFAULT NULL,
279 attempt_ip varchar(250) DEFAULT NULL,
280 attempt_started_at datetime DEFAULT NULL,
281 attempt_ended_at datetime DEFAULT NULL,
282 is_manually_reviewed int(1) DEFAULT NULL,
283 manually_reviewed_at datetime DEFAULT NULL,
284 PRIMARY KEY (attempt_id)
285 ) $charset_collate;";
286
287 $quiz_attempt_answers = "CREATE TABLE {$wpdb->prefix}tutor_quiz_attempt_answers (
288 attempt_answer_id int(11) NOT NULL AUTO_INCREMENT,
289 user_id int(11) DEFAULT NULL,
290 quiz_id int(11) DEFAULT NULL,
291 question_id int(11) DEFAULT NULL,
292 quiz_attempt_id int(11) DEFAULT NULL,
293 given_answer longtext,
294 question_mark decimal(8,2) DEFAULT NULL,
295 achieved_mark decimal(8,2) DEFAULT NULL,
296 minus_mark decimal(8,2) DEFAULT NULL,
297 is_correct tinyint(4) DEFAULT NULL,
298 PRIMARY KEY (attempt_answer_id)
299 ) $charset_collate;";
300
301 $tutor_quiz_questions = "CREATE TABLE {$wpdb->prefix}tutor_quiz_questions (
302 question_id int(11) NOT NULL AUTO_INCREMENT,
303 quiz_id int(11) DEFAULT NULL,
304 question_title text,
305 question_description longtext,
306 question_type varchar(50) DEFAULT NULL,
307 question_mark decimal(9,2) DEFAULT NULL,
308 question_settings longtext,
309 question_order int(11) DEFAULT NULL,
310 PRIMARY KEY (question_id)
311 ) $charset_collate;";
312
313 $tutor_quiz_question_answers = "CREATE TABLE {$wpdb->prefix}tutor_quiz_question_answers (
314 answer_id int(11) NOT NULL AUTO_INCREMENT,
315 belongs_question_id int(11) DEFAULT NULL,
316 belongs_question_type varchar(250) DEFAULT NULL,
317 answer_title text,
318 is_correct tinyint(4) DEFAULT NULL,
319 image_id int(11) DEFAULT NULL,
320 answer_two_gap_match text,
321 answer_view_format varchar(250) DEFAULT NULL,
322 answer_settings text,
323 answer_order int(11) DEFAULT '0',
324 PRIMARY KEY (answer_id)
325 ) $charset_collate;";
326
327 $earning_table = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}tutor_earnings (
328 earning_id int(11) NOT NULL AUTO_INCREMENT,
329 user_id int(11) DEFAULT NULL,
330 course_id int(11) DEFAULT NULL,
331 order_id int(11) DEFAULT NULL,
332 order_status varchar(50) DEFAULT NULL,
333 course_price_total decimal(16,2) DEFAULT NULL,
334 course_price_grand_total decimal(16,2) DEFAULT NULL,
335 instructor_amount decimal(16,2) DEFAULT NULL,
336 instructor_rate decimal(16,2) DEFAULT NULL,
337 admin_amount decimal(16,2) DEFAULT NULL,
338 admin_rate decimal(16,2) DEFAULT NULL,
339 commission_type varchar(20) DEFAULT NULL,
340 deduct_fees_amount decimal(16,2) DEFAULT NULL,
341 deduct_fees_name varchar(250) DEFAULT NULL,
342 deduct_fees_type varchar(20) DEFAULT NULL,
343 process_by varchar(20) DEFAULT NULL,
344 created_at datetime DEFAULT NULL,
345 PRIMARY KEY (earning_id)
346 ) $charset_collate;";
347
348 $withdraw_table = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}tutor_withdraws (
349 withdraw_id int(11) NOT NULL AUTO_INCREMENT,
350 user_id int(11) DEFAULT NULL,
351 amount decimal(16,2) DEFAULT NULL,
352 method_data text DEFAULT NULL,
353 status varchar(50) DEFAULT NULL,
354 updated_at datetime DEFAULT NULL,
355 created_at datetime DEFAULT NULL,
356 PRIMARY KEY (withdraw_id)
357 ) $charset_collate;";
358
359 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
360 dbDelta( $quiz_attempts_sql );
361 dbDelta( $quiz_attempt_answers );
362 dbDelta( $tutor_quiz_questions );
363 dbDelta( $tutor_quiz_question_answers );
364 dbDelta( $earning_table );
365 dbDelta( $withdraw_table );
366 }
367
368 public static function manage_tutor_roles_and_permissions(){
369 /**
370 * Add role for instructor
371 */
372 $instructor_role = tutor()->instructor_role;
373
374 remove_role($instructor_role);
375 add_role( $instructor_role, __('Tutor Instructor', 'tutor'), array() );
376
377 $custom_post_type_permission = array(
378 //Manage Instructor
379 'manage_tutor_instructor',
380
381 //Tutor Posts Type Permission
382 'edit_tutor_course',
383 'read_tutor_course',
384 'delete_tutor_course',
385 'delete_tutor_courses',
386 'edit_tutor_courses',
387 'edit_others_tutor_courses',
388 'read_private_tutor_courses',
389 'edit_tutor_courses',
390
391 'edit_tutor_lesson',
392 'read_tutor_lesson',
393 'delete_tutor_lesson',
394 'delete_tutor_lessons',
395 'edit_tutor_lessons',
396 'edit_others_tutor_lessons',
397 'read_private_tutor_lessons',
398 'edit_tutor_lessons',
399 'publish_tutor_lessons',
400
401 'edit_tutor_quiz',
402 'read_tutor_quiz',
403 'delete_tutor_quiz',
404 'delete_tutor_quizzes',
405 'edit_tutor_quizzes',
406 'edit_others_tutor_quizzes',
407 'read_private_tutor_quizzes',
408 'edit_tutor_quizzes',
409 'publish_tutor_quizzes',
410
411 'edit_tutor_question',
412 'read_tutor_question',
413 'delete_tutor_question',
414 'delete_tutor_questions',
415 'edit_tutor_questions',
416 'edit_others_tutor_questions',
417 'publish_tutor_questions',
418 'read_private_tutor_questions',
419 'edit_tutor_questions',
420 );
421
422 $instructor = get_role( $instructor_role );
423 if ( $instructor ) {
424 $instructor_cap = array (
425 'edit_posts',
426 'read',
427 'upload_files',
428 );
429
430 $instructor_cap = array_merge($instructor_cap, $custom_post_type_permission);
431
432 $can_publish_course = (bool) tutor_utils()->get_option('instructor_can_publish_course');
433 if ($can_publish_course){
434 $instructor_cap[] = 'publish_tutor_courses';
435 }
436
437 foreach ($instructor_cap as $cap){
438 $instructor->add_cap( $cap );
439 }
440 }
441
442 $administrator = get_role( 'administrator' );
443 if ( $administrator ) {
444
445 $administrator_cap = array (
446 'manage_tutor',
447 );
448 $administrator_cap = array_merge($administrator_cap, $custom_post_type_permission);
449 $administrator_cap[] = 'publish_tutor_courses';
450
451 foreach ($administrator_cap as $cap){
452 $administrator->add_cap( $cap );
453 }
454 }
455
456 /**
457 * Add Instructor role to administrator
458 */
459 if (current_user_can('administrator')){
460 tutor_utils()->add_instructor_role(get_current_user_id());
461 }
462
463 }
464
465 /**
466 * Save data like page
467 */
468 public static function save_data(){
469 $student_dashboard_args = array(
470 'post_title' => __('Dashboard', 'tutor'),
471 'post_content' => '',
472 'post_type' => 'page',
473 'post_status' => 'publish',
474 );
475 $student_dashboard_page_id = wp_insert_post( $student_dashboard_args );
476 tutor_utils()->update_option('tutor_dashboard_page_id', $student_dashboard_page_id);
477
478 $student_registration_args = array(
479 'post_title' => __('Student Registration', 'tutor'),
480 'post_content' => '[tutor_student_registration_form]',
481 'post_type' => 'page',
482 'post_status' => 'publish',
483 );
484 $student_register_page_id = wp_insert_post( $student_registration_args );
485 tutor_utils()->update_option('student_register_page', $student_register_page_id);
486
487 $instructor_registration_args = array(
488 'post_title' => __('Instructor Registration', 'tutor'),
489 'post_content' => '[tutor_instructor_registration_form]',
490 'post_type' => 'page',
491 'post_status' => 'publish',
492 );
493 $instructor_registration_id = wp_insert_post( $instructor_registration_args );
494 tutor_utils()->update_option('instructor_register_page', $instructor_registration_id);
495 }
496
497 public static function default_options(){
498 $options = array (
499 'pagination_per_page' => '20',
500 'load_tutor_css' => '1',
501 'load_tutor_js' => '1',
502 'course_allow_upload_private_files' => '1',
503 'display_course_instructors' => '1',
504 'enable_q_and_a_on_course' => '1',
505 'courses_col_per_row' => '3',
506 'courses_per_page' => '3',
507 'lesson_permalink_base' => 'lesson',
508 'quiz_time_limit' =>
509 array (
510 'value' => '0',
511 'time' => 'minutes',
512 ),
513 'quiz_when_time_expires' => 'autosubmit',
514 'quiz_attempts_allowed' => '10',
515 'quiz_grade_method' => 'highest_grade',
516 'enable_public_profile' => '1',
517 'email_to_students' =>
518 array (
519 'quiz_completed' => '1',
520 'completed_course' => '1',
521 ),
522 'email_to_instructors' =>
523 array (
524 'a_student_enrolled_in_course' => '1',
525 'a_student_completed_course' => '1',
526 'a_student_completed_lesson' => '1',
527 'a_student_placed_question' => '1',
528 ),
529 'email_from_name' => get_option('blogname'),
530 'email_from_address' => get_option('admin_email'),
531 'email_footer_text' => '',
532 );
533 return $options;
534 }
535
536
537 /**
538 * Create withdraw database
539 *
540 * @since v.1.2.0
541 */
542 public function create_withdraw_database(){
543 global $wpdb;
544
545 $charset_collate = $wpdb->get_charset_collate();
546
547 /**
548 * Table SQL
549 *
550 * {$wpdb->prefix}tutor_earnings
551 * {$wpdb->prefix}tutor_withdraws
552 *
553 * @since v.1.2.0
554 */
555
556 $earning_table = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}tutor_earnings (
557 earning_id int(11) NOT NULL AUTO_INCREMENT,
558 user_id int(11) DEFAULT NULL,
559 course_id int(11) DEFAULT NULL,
560 order_id int(11) DEFAULT NULL,
561 order_status varchar(50) DEFAULT NULL,
562 course_price_total decimal(16,2) DEFAULT NULL,
563 course_price_grand_total decimal(16,2) DEFAULT NULL,
564 instructor_amount decimal(16,2) DEFAULT NULL,
565 instructor_rate decimal(16,2) DEFAULT NULL,
566 admin_amount decimal(16,2) DEFAULT NULL,
567 admin_rate decimal(16,2) DEFAULT NULL,
568 commission_type varchar(20) DEFAULT NULL,
569 deduct_fees_amount decimal(16,2) DEFAULT NULL,
570 deduct_fees_name varchar(250) DEFAULT NULL,
571 deduct_fees_type varchar(20) DEFAULT NULL,
572 process_by varchar(20) DEFAULT NULL,
573 created_at datetime DEFAULT NULL,
574 PRIMARY KEY (earning_id)
575 ) $charset_collate;";
576
577 $withdraw_table = "CREATE TABLE IF NOT EXISTS {$wpdb->prefix}tutor_withdraws (
578 withdraw_id int(11) NOT NULL AUTO_INCREMENT,
579 user_id int(11) DEFAULT NULL,
580 amount decimal(16,2) DEFAULT NULL,
581 method_data text DEFAULT NULL,
582 status varchar(50) DEFAULT NULL,
583 updated_at datetime DEFAULT NULL,
584 created_at datetime DEFAULT NULL,
585 PRIMARY KEY (withdraw_id)
586 ) $charset_collate;";
587
588 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
589 dbDelta( $earning_table );
590 dbDelta( $withdraw_table );
591
592 /**
593 * Setting previous dashboard to new dashboard
594 */
595 $previous_dashboard_page_id = (int) tutor_utils()->get_option('student_dashboard');
596 tutor_utils()->update_option('tutor_dashboard_page_id', $previous_dashboard_page_id);
597 }
598
599 /**
600 * @param $bool
601 *
602 * @return bool
603 *
604 * Filter the wp_doing_ajax from tutor requests to get advanced advantages from Tutor
605 *
606 * @since v.1.3.4
607 */
608 public function wp_doing_ajax($bool){
609 if (isset($_REQUEST['tutor_ajax_action'])){
610 return true;
611 }
612 return $bool;
613 }
614
615
616 }