Addons.php
7 years ago
Admin.php
7 years ago
Ajax.php
7 years ago
Assets.php
7 years ago
Course.php
7 years ago
Gutenberg.php
7 years ago
Instructor.php
7 years ago
Instructors_List.php
7 years ago
Lesson.php
7 years ago
Options.php
7 years ago
Post_types.php
7 years ago
Q_and_A.php
7 years ago
Question.php
7 years ago
Question_Answers_List.php
7 years ago
Quiz.php
7 years ago
Quiz_Attempts_List.php
7 years ago
Rewrite_Rules.php
7 years ago
Shortcode.php
7 years ago
Student.php
7 years ago
Students_List.php
7 years ago
Template.php
7 years ago
Theme_Compatibility.php
7 years ago
Tools.php
7 years ago
Tutor.php
7 years ago
TutorEDD.php
7 years ago
Tutor_Base.php
7 years ago
Tutor_List_Table.php
7 years ago
User.php
7 years ago
Utils.php
7 years ago
Video_Stream.php
7 years ago
Withdraw.php
7 years ago
Withdraw_Requests_List.php
7 years ago
WooCommerce.php
7 years ago
Tools.php
26 lines
| 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 | } |