Skip to content

Commit

Permalink
Deleting bulk argument if task is deleted #30
Browse files Browse the repository at this point in the history
  • Loading branch information
grogou committed Aug 15, 2019
1 parent cec1eec commit 307e342
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/admin_menu/class-btm-admin-task-page-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ private function delete_tasks(){
}

BTM_Task_Dao::get_instance()->delete_many_by_ids( $to_delete );
foreach ( $to_delete as $task_id ){
$bulk_arguments = BTM_Task_Bulk_Argument_Dao::get_instance()->get_by_task_id( (int)$task_id );
foreach ( $bulk_arguments as $bulk_argument ){
BTM_Task_Bulk_Argument_Dao::get_instance()->delete( $bulk_argument );
}
}

if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {
wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce', 'action', static::BULK_ACTION_DELETE, ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
Expand Down

0 comments on commit 307e342

Please sign in to comment.