/** * Process bulk actions */ public function process_bulk_action() { if ('delete' === $this->current_action()) { // check nonce if (empty($_POST['_wpnonce']) || !wp_verify_nonce($_POST['_wpnonce'], 'bulk-' . $this->_args['plural'])) { wp_die('process_bulk_action() nonce check failed'); } // check capability if (!current_user_can('dlm_manage_logs')) { wp_die("You're not allowed to delete logs!"); } // logging object $logging = new DLM_Logging(); // check if (count($_POST['log']) > 0) { // delete the posted logs foreach ($_POST['log'] as $log_id) { $logging->delete_log(absint($log_id)); } // display delete message $this->display_delete_message = true; } } }