| @@ -53,29 +53,21 @@ | ||
| 53 | 53 | foreach ( $aawp_amazon_ids as $amazon_id ) { |
| 54 | 54 | $url_detail = $lasso_db->get_url_details_by_product_id( $amazon_id, Amazon_Api::PRODUCT_TYPE ); |
| 55 | 55 | if ( $url_detail ) { |
| 56 | 56 | $import_id = $url_detail->lasso_id; |
| 57 | - wp_update_post( | |
| 58 | - array( | |
| 59 | - 'ID' => $import_id, | |
| 60 | - 'post_status' => 'trash', | |
| 61 | - ) | |
| 62 | - ); | |
| 57 | + wp_delete_post( $import_id ); | |
| 63 | 58 | $status = $lasso_db->process_revert( $import_id, false ); |
| 64 | 59 | } |
| 65 | 60 | } |
| 66 | 61 | } elseif ( isset( $import_source ) && in_array( $import_source, array( 'AAWP', 'AmaLinks Pro', 'EasyAzon' ), true ) ) { |
| 67 | - wp_update_post( | |
| 68 | - array( | |
| 69 | - 'ID' => $import_id, | |
| 70 | - 'post_status' => 'trash', | |
| 71 | - ) | |
| 72 | - ); | |
| 62 | + wp_delete_post( $import_id ); | |
| 73 | 63 | $status = $lasso_db->process_revert( $import_id, false ); |
| 74 | 64 | } else { |
| 75 | 65 | $status = $lasso_db->process_revert( $import_id ); |
| 76 | 66 | delete_post_meta( $import_id, 'affiliate_link_type' ); |
| 77 | 67 | } |
| 68 | + | |
| 69 | + $lasso_db->delete_url_details( $import_id ); | |
| 78 | 70 | |
| 79 | 71 | // ? clear cache after reverting |
| 80 | 72 | Lasso_Cache_Per_Process::get_instance()->un_set( self::OBJECT_KEY . '_' . $import_id ); |
| 81 | 73 | Lasso_Cache_Per_Process::get_instance()->un_set( 'wp_post_' . $import_id ); |