| @@ 329-342 (lines=14) @@ | ||
| 326 | $time_to_leave_alone |
|
| 327 | ); |
|
| 328 | //now that we have the ids to delete |
|
| 329 | if (! empty($txn_ids) && is_array($txn_ids)) { |
|
| 330 | // first, make sure these TXN's are removed the "ee_locked_transactions" array |
|
| 331 | EEM_Transaction::unset_locked_transactions($txn_ids); |
|
| 332 | // let's get deletin'... |
|
| 333 | // Why no wpdb->prepare? Because the data is trusted. |
|
| 334 | // We got the ids from the original query to get them FROM |
|
| 335 | // the db (which is sanitized) so no need to prepare them again. |
|
| 336 | $query = ' |
|
| 337 | DELETE |
|
| 338 | FROM ' . $this->table() . ' |
|
| 339 | WHERE |
|
| 340 | TXN_ID IN ( ' . implode(",", $txn_ids) . ')'; |
|
| 341 | $deleted = $wpdb->query($query); |
|
| 342 | } |
|
| 343 | if ($deleted) { |
|
| 344 | /** |
|
| 345 | * Allows code to do something after the transactions have been deleted. |
|
| @@ 543-551 (lines=9) @@ | ||
| 540 | ) |
|
| 541 | ); |
|
| 542 | ||
| 543 | if(! empty($message_ids_to_delete) && is_array($message_ids_to_delete)) { |
|
| 544 | global $wpdb; |
|
| 545 | $number_deleted = $wpdb->query(' |
|
| 546 | DELETE |
|
| 547 | FROM ' . $this->table() . ' |
|
| 548 | WHERE |
|
| 549 | MSG_ID IN (' . implode(",", $message_ids_to_delete) . ') |
|
| 550 | '); |
|
| 551 | } |
|
| 552 | ||
| 553 | /** |
|
| 554 | * This will get called if the number of records deleted 0 or greater. So a successful deletion is one where |
|