From 04a27389ef44353a2f2dcf017da4c31bb331df45 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Mon, 26 Jun 2017 14:11:27 +0100 Subject: [PATCH] Clean up failed imports --- includes/admin/class-wc-admin-importers.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/admin/class-wc-admin-importers.php b/includes/admin/class-wc-admin-importers.php index 8c02b9642cd..5b1a31d2c8a 100644 --- a/includes/admin/class-wc-admin-importers.php +++ b/includes/admin/class-wc-admin-importers.php @@ -230,6 +230,8 @@ class WC_Admin_Importers { if ( 100 === $percent_complete ) { // Clear temp meta. $wpdb->delete( $wpdb->postmeta, array( 'meta_key' => '_original_id' ) ); + $wpdb->delete( $wpdb->posts, array( 'post_status' => 'importing', 'post_type' => 'product' ) ); + $wpdb->delete( $wpdb->posts, array( 'post_status' => 'importing', 'post_type' => 'product_variation' ) ); // Send success. wp_send_json_success( array(