| @@ 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 |
|
| @@ 344-357 (lines=14) @@ | ||
| 341 | $time_to_leave_alone |
|
| 342 | ); |
|
| 343 | //now that we have the ids to delete |
|
| 344 | if (! empty($txn_ids) && is_array($txn_ids)) { |
|
| 345 | // first, make sure these TXN's are removed the "ee_locked_transactions" array |
|
| 346 | EEM_Transaction::unset_locked_transactions($txn_ids); |
|
| 347 | // let's get deletin'... |
|
| 348 | // Why no wpdb->prepare? Because the data is trusted. |
|
| 349 | // We got the ids from the original query to get them FROM |
|
| 350 | // the db (which is sanitized) so no need to prepare them again. |
|
| 351 | $query = ' |
|
| 352 | DELETE |
|
| 353 | FROM ' . $this->table() . ' |
|
| 354 | WHERE |
|
| 355 | TXN_ID IN ( ' . implode(",", $txn_ids) . ')'; |
|
| 356 | $deleted = $wpdb->query($query); |
|
| 357 | } |
|
| 358 | if ($deleted) { |
|
| 359 | /** |
|
| 360 | * Allows code to do something after the transactions have been deleted. |
|