PluginProbe
Tutor LMS – eLearning and online course solution / 1.0.7
Tutor LMS – eLearning and online course solution v1.0.7
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.0.7, at classes/Tools.php

26 lines 610 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
6 class Tools {
7
8 public function __construct() {
9 add_action('tutor_once_in_day_run_schedule', array($this, 'delete_auto_draft_posts'));
10 }
11
12 /**
13 * Delete draft question schedule basis
14 */
15 public function delete_auto_draft_posts() {
16 global $wpdb;
17
18 $draft_questions_ids = $wpdb->get_col("SELECT ID from {$wpdb->posts} WHERE post_type = 'tutor_question' AND post_status = 'auto-draft' ");
19 if (is_array($draft_questions_ids) && count($draft_questions_ids)){
20 foreach ($draft_questions_ids as $draft_questions_id){
21 wp_delete_post($draft_questions_id, true);
22 }
23 }
24 }
25
26 }