PluginProbe
Tutor LMS – eLearning and online course solution / 1.3.5
Tutor LMS – eLearning and online course solution v1.3.5
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.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 All 191 releases
tutor / classes / Tools.php

Tools.php in Tutor LMS – eLearning and online course solution 1.3.5, at classes/Tools.php

31 lines 650 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace TUTOR;
4
5 if ( ! defined( 'ABSPATH' ) )
6 exit;
7
8
9 class Tools {
10
11 public function __construct() {
12 add_action('tutor_once_in_day_run_schedule', array($this, 'delete_auto_draft_posts'));
13 }
14
15 /**
16 * Delete draft question schedule basis
17 */
18 public function delete_auto_draft_posts() {
19 global $wpdb;
20
21 $draft_questions_ids = $wpdb->get_col("SELECT ID from {$wpdb->posts} WHERE post_type = 'tutor_question' AND post_status = 'auto-draft' ");
22 if (is_array($draft_questions_ids) && count($draft_questions_ids)){
23 foreach ($draft_questions_ids as $draft_questions_id){
24 wp_delete_post($draft_questions_id, true);
25 }
26 }
27 }
28
29
30
31 }