diff --git a/src/Admin/Native/PayChargeCards.php b/src/Admin/Native/PayChargeCards.php index dc6bf1c0..4cc815b3 100644 --- a/src/Admin/Native/PayChargeCards.php +++ b/src/Admin/Native/PayChargeCards.php @@ -21,11 +21,8 @@ class PayChargeCards { public const NONCE = 'aksrt_card_pass_page'; public const EXPORT_AJAX_ACTION = 'aksrt_card_pass_export'; - /** 每页条数默认值;列表页可由 ice_perpage 覆盖。 */ - public const DEFAULT_PER_PAGE = 30; - - /** 「每页显示」下拉的可选值。 */ - private const PER_PAGE_CHOICES = [10, 20, 30, 50, 100]; + /** 每页条数默认值;列表页可由 ice_perpage 覆盖(无界面控件,仅供 URL / 程序化调用)。 */ + public const DEFAULT_PER_PAGE = 20; private static $instance = null; @@ -158,12 +155,11 @@ class PayChargeCards { '; - // 当前筛选参数(不含 paged)。分页链接与「每页显示」表单都显式带上它, - // 不再依赖 add_query_arg() 默认取 $_SERVER['REQUEST_URI'](链接会随环境漂移,且列条件容易丢)。 + // 当前筛选参数(不含 paged)。分页链接显式带上它,不再依赖 add_query_arg() + // 默认取 $_SERVER['REQUEST_URI'](链接会随环境漂移,且列条件容易丢)。 $query_args = $this->list_query_args($status, $type, $other, $s, $orderby, $order, $per_page); - echo '
' - . '
' . $this->per_page_selector($per_page, $query_args) . $search . '
'; + echo '
' . $search . '
'; $filters = [ 'status' => $status, @@ -1050,44 +1046,6 @@ class PayChargeCards { return $args; } - /** - * 「每页显示」选择器。 - * - * 服务端一直支持 ice_perpage,但界面上没有任何地方能改它 —— 每页条数恒等于默认值, - * 于是数据量小于默认每页条数时永远只有一页,四个翻页按钮恒为 disabled, - * 看起来就是「分页是坏的」。补上这个入口之后,条数、页码才有意义。 - * - * @param array $query_args 当前筛选参数(ice_perpage 由本表单自己提供)。 - */ - private function per_page_selector(int $per_page, array $query_args): string { - $choices = self::PER_PAGE_CHOICES; - if (!in_array($per_page, $choices, true)) { - $choices[] = $per_page; - sort($choices); - } - - $hidden = ''; - foreach ($query_args as $key => $value) { - if ($key === 'ice_perpage') { - continue; - } - $hidden .= ''; - } - - $options = ''; - foreach ($choices as $choice) { - $options .= ''; - } - - return '
' - . $hidden - . '' - . '' . esc_html__('每页显示', 'aksrt') . '' - . '' - . '' - . '
'; - } - /** * 分页(参考主题 zibpay_admin_pagenavi 同款结构与禁用逻辑)。 * @@ -1140,9 +1098,6 @@ class PayChargeCards {