diff --git a/src/log/class-logservice.php b/src/log/class-logservice.php index 345391b..9b4cd05 100644 --- a/src/log/class-logservice.php +++ b/src/log/class-logservice.php @@ -200,7 +200,9 @@ public function delete_all_logs() { ); foreach ( $all as $log ) { - wp_delete_post( $log->ID ); + if ( $log->post_type === $this->post_type ) { + wp_delete_post( $log->ID ); + } } return true; @@ -224,7 +226,9 @@ public function prune_logs( $int_time_diff ) { ); foreach ( $all as $log ) { - wp_delete_post( $log->ID ); + if ( $log->post_type === $this->post_type ) { + wp_delete_post( $log->ID ); + } } return true; @@ -254,7 +258,9 @@ public function delete_all_logs_to_email( $email ) { // @phpcs:enable foreach ( $all as $log ) { - wp_delete_post( $log->ID ); + if ( $log->post_type === $this->post_type ) { + wp_delete_post( $log->ID ); + } } return count( $all );