Clean up failed imports

This commit is contained in:
Mike Jolley 2017-06-26 14:11:27 +01:00
parent 4972e83e51
commit 04a27389ef
1 changed files with 2 additions and 0 deletions

View File

@ -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(