diff --git a/src/Admin/Native/PayDownloadLogs.php b/src/Admin/Native/PayDownloadLogs.php index 77f42357..a79d7cb9 100644 --- a/src/Admin/Native/PayDownloadLogs.php +++ b/src/Admin/Native/PayDownloadLogs.php @@ -11,6 +11,10 @@ class PayDownloadLogs { public const CAPABILITY = 'manage_options'; public const PAGE_SLUG = 'aksrt_download_logs'; + public const NONCE = 'aksrt_download_logs_bulk'; + + /** 单次批量删除的令牌上限,与列表每页条数量级一致,防止超大 IN 查询。 */ + private const BULK_DELETE_LIMIT = 100; private static $instance = null; @@ -22,13 +26,28 @@ class PayDownloadLogs { } public function init(): void { - // Read-only. + // 页面动作(批量删除)在 render_page() 渲染前就地处理,无需额外钩子。 } public function render_page(): void { $this->ensure_cap(); + + if ($this->is_bulk_delete_request()) { + $this->handle_bulk_delete(); + } + echo '
' . esc_html(sprintf( + /* translators: %d: deleted record count */ + __('已删除 %d 条下载记录。', 'aksrt'), + max(0, (int) $_GET['dl_deleted']) + )) . '
' . esc_html__('未选择需要删除的记录。', 'aksrt') . '
' . esc_html__('数据库服务不可用。', 'aksrt') . '