PluginProbe
Lasso Lite – Affiliate Link Manager & Product Displays / 113
Lasso Lite – Affiliate Link Manager & Product Displays v113
158 157 155 156 154 153 152 151 150 149 148 trunk 0.9.9 104 105 106 107 108 109 110 111 112 113 114 115 All 57 releases
← All changes | classes/class-import.php +4 -12 116113 View file →
@@ -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 );