Skip to content

Commit d294c13

Browse files
committed
fix: zoom meeting not deleting with course delete
1 parent b88f65f commit d294c13

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

models/CourseModel.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,23 @@ public function delete_course_data( $post_id ) {
250250
}
251251

252252
wp_delete_post( $content_id, true );
253+
254+
253255
}
254256

255257
wp_delete_post( $topic_id, true );
258+
// Delete zoom meeting.
259+
$wpdb->delete(
260+
$wpdb->posts,
261+
array(
262+
'post_parent' => $topic_id,
263+
'post_type' => 'tutor_zoom_meeting'
264+
)
265+
);
256266
}
257267
}
258268

259-
$child_post_ids = $this->get_post_ids( array( 'tutor_announcements', 'tutor_enrolled' ), $post_id );
269+
$child_post_ids = $this->get_post_ids( array( 'tutor_announcements', 'tutor_enrolled', 'tutor_zoom_meeting' ), $post_id );
260270
if ( ! empty( $child_post_ids ) ) {
261271
foreach ( $child_post_ids as $child_post_id ) {
262272
wp_delete_post( $child_post_id, true );
@@ -265,6 +275,7 @@ public function delete_course_data( $post_id ) {
265275

266276
/**
267277
* Delete earning, gradebook result, course complete data
278+
*
268279
* @since 2.0.9
269280
*/
270281
$wpdb->delete( $wpdb->prefix . 'tutor_earnings', array( 'course_id' => $post_id ) );

readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ Looking for the best LMS for WordPress? Get Tutor and start your e-learning webs
225225

226226
== Changelog ==
227227

228-
= 2.0.9 - August 11, 2022
228+
= 2.0.9 - August 18, 2022
229229

230230
New: Custom Time setting for showing Answer in the Quiz Reveal mode is introduced
231231
New: Admin/Instructor will be able to add Code Blocks inside a Lesson/Assignment/Quiz

0 commit comments

Comments
 (0)