From 80991d83470e9dcf687566a8ff31af6469021662 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Jul 2026 13:13:07 +0800 Subject: [PATCH 1/4] fix(widgets): strip remaining decorative forum/oneline ajaxpagers Board list, plate lists, topic terms and oneline posts no longer wrap static SSR in inert ajaxpager attributes without a real pager. --- src/AKSRT/Widgets/WidgetForumBoardList.php | 3 --- src/AKSRT/Widgets/WidgetForumPlateLists.php | 4 +--- src/AKSRT/Widgets/WidgetForumTopicTerms.php | 4 +--- src/AKSRT/Widgets/WidgetOnelinePosts.php | 3 --- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/AKSRT/Widgets/WidgetForumBoardList.php b/src/AKSRT/Widgets/WidgetForumBoardList.php index 369276df..c66869fa 100644 --- a/src/AKSRT/Widgets/WidgetForumBoardList.php +++ b/src/AKSRT/Widgets/WidgetForumBoardList.php @@ -140,10 +140,7 @@ class WidgetForumBoardList extends \WP_Widget { echo $args['before_widget']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $args['before_title'] . esc_html($title) . $args['after_title']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - $rest = rest_url('aksrt/v1/widgets/forum-boards'); - echo '
'; echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - echo '
'; echo $args['after_widget']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } diff --git a/src/AKSRT/Widgets/WidgetForumPlateLists.php b/src/AKSRT/Widgets/WidgetForumPlateLists.php index 93bb6184..7bb08f01 100644 --- a/src/AKSRT/Widgets/WidgetForumPlateLists.php +++ b/src/AKSRT/Widgets/WidgetForumPlateLists.php @@ -151,9 +151,7 @@ class WidgetForumPlateLists extends \WP_Widget { echo $args['before_title'] . esc_html($title) . $args['after_title']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } - // IAS-like: first paint is SSR; optional remote refresh via rest for customize. - $rest = rest_url('aksrt/v1/forum/frontend/widgets/plates'); - echo '
'; + echo '
'; echo $payload['html']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo '
'; diff --git a/src/AKSRT/Widgets/WidgetForumTopicTerms.php b/src/AKSRT/Widgets/WidgetForumTopicTerms.php index 7bd24532..f76394b3 100644 --- a/src/AKSRT/Widgets/WidgetForumTopicTerms.php +++ b/src/AKSRT/Widgets/WidgetForumTopicTerms.php @@ -105,9 +105,7 @@ class WidgetForumTopicTerms extends \WP_Widget { if ($title !== '') { echo $args['before_title'] . esc_html($title) . $args['after_title']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } - // IAS-style wrap for remote refresh. - $rest = rest_url('aksrt/v1/widgets/forum-terms'); - echo '
'; + echo '
'; echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo '
'; echo $args['after_widget']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped diff --git a/src/AKSRT/Widgets/WidgetOnelinePosts.php b/src/AKSRT/Widgets/WidgetOnelinePosts.php index 68a3f343..9d0e2204 100644 --- a/src/AKSRT/Widgets/WidgetOnelinePosts.php +++ b/src/AKSRT/Widgets/WidgetOnelinePosts.php @@ -185,10 +185,7 @@ class WidgetOnelinePosts extends \WP_Widget { if ($title !== '') { echo $args['before_title'] . esc_html($title) . $args['after_title']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } - $rest = rest_url('aksrt/v1/widgets/oneline-posts'); - echo '
'; echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - echo '
'; echo $args['after_widget']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } From 1de0cac8df254639f5b295f7af4125d81ce58955 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Jul 2026 13:13:07 +0800 Subject: [PATCH 2/4] feat(widgets): number paginate for category block/recent/product tab Extend form/query/REST number pager support to category block and forum recent; product tab form exposes number mode already supported by list. --- src/AKSRT/Widgets/CategoryBlockWidget.php | 32 +++++++++++-------- src/AKSRT/Widgets/WidgetForumRecentTopics.php | 3 +- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/AKSRT/Widgets/CategoryBlockWidget.php b/src/AKSRT/Widgets/CategoryBlockWidget.php index 80f72769..953c6773 100644 --- a/src/AKSRT/Widgets/CategoryBlockWidget.php +++ b/src/AKSRT/Widgets/CategoryBlockWidget.php @@ -337,7 +337,7 @@ class CategoryBlockWidget extends \WP_Widget { $context ); $paginate = sanitize_key((string) ($instance['paginate'] ?? 'none')); - if (!in_array($paginate, ['ajax', 'none'], true)) { + if (!in_array($paginate, ['ajax', 'none', 'number'], true)) { $paginate = 'none'; } @@ -367,21 +367,26 @@ class CategoryBlockWidget extends \WP_Widget { $max_pages = max(1, (int) $query->max_num_pages); $total = (int) $query->found_posts; - $has_more = $paginate === 'ajax' && $page < $max_pages; + $has_more = in_array($paginate, ['ajax', 'number'], true) && $page < $max_pages; + $base_qs = [ + 'count' => $count, + 'cat' => $category_id, + 'columns' => $columns, + 'layout' => $layout, + 'context' => $context, + 'paginate' => $paginate, + ]; + $rest_base = add_query_arg($base_qs, rest_url('aksrt/v1/widgets/category-block')); $paginate_html = ''; if ($paginate === 'ajax' && $has_more) { - $next = add_query_arg([ - 'page' => $page + 1, - 'count' => $count, - 'cat' => $category_id, - 'columns' => $columns, - 'layout' => $layout, - 'context' => $context, - 'paginate' => 'ajax', - ], rest_url('aksrt/v1/widgets/category-block')); + $next = add_query_arg(['page' => $page + 1], $rest_base); $paginate_html = function_exists('aksrt_get_ajax_next_paginate') ? aksrt_get_ajax_next_paginate($total, $page, $count, $next) : ''; + } elseif ($paginate === 'number' && $max_pages > 1) { + $paginate_html = function_exists('aksrt_get_ajax_number_paginate') + ? aksrt_get_ajax_number_paginate($total, $page, $count, $rest_base) + : '
'; } else { $paginate_html = '
'; } @@ -397,7 +402,7 @@ class CategoryBlockWidget extends \WP_Widget { $title = $title !== '' ? $title : (($term && ! is_wp_error($term)) ? $term->name : __('精选分类', 'aksrt')); $show_more = ! empty($instance['show_more']); $paginate = sanitize_key((string) ($instance['paginate'] ?? 'none')); - if (!in_array($paginate, ['ajax', 'none'], true)) { + if (!in_array($paginate, ['ajax', 'none', 'number'], true)) { $paginate = 'none'; } $instance['paginate'] = $paginate; @@ -475,6 +480,7 @@ class CategoryBlockWidget extends \WP_Widget {

@@ -490,7 +496,7 @@ class CategoryBlockWidget extends \WP_Widget { 'columns' => max(1, min(4, absint($new_instance['columns'] ?? 3))), 'layout' => aksrt_home_widget_resolve_layout($new_instance['layout'] ?? 'card', 'card'), 'show_more' => ! empty($new_instance['show_more']) ? 1 : 0, - 'paginate' => sanitize_key((string) ($new_instance['paginate'] ?? 'none')) === 'ajax' ? 'ajax' : 'none', + 'paginate' => in_array(sanitize_key((string) ($new_instance['paginate'] ?? 'none')), ['none', 'ajax', 'number'], true) ? sanitize_key((string) ($new_instance['paginate'] ?? 'none')) : 'none', ]; } diff --git a/src/AKSRT/Widgets/WidgetForumRecentTopics.php b/src/AKSRT/Widgets/WidgetForumRecentTopics.php index 5750f31d..b48a93c5 100644 --- a/src/AKSRT/Widgets/WidgetForumRecentTopics.php +++ b/src/AKSRT/Widgets/WidgetForumRecentTopics.php @@ -79,6 +79,7 @@ class WidgetForumRecentTopics extends \WP_Widget { @@ -96,7 +97,7 @@ class WidgetForumRecentTopics extends \WP_Widget { 'count' => max(1, min(20, (int) ($new_instance['count'] ?? 5))), 'plate' => max(0, (int) ($new_instance['plate'] ?? 0)), 'style' => $style, - 'paginate' => sanitize_key((string) ($new_instance['paginate'] ?? 'ajax')) === 'none' ? 'none' : 'ajax', + 'paginate' => in_array(sanitize_key((string) ($new_instance['paginate'] ?? 'ajax')), ['none', 'ajax', 'number'], true) ? sanitize_key((string) ($new_instance['paginate'] ?? 'ajax')) : 'ajax', ]; } } From c507ffaa2307e5437b1894b788f0bb5c41096215 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Jul 2026 13:13:08 +0800 Subject: [PATCH 3/4] feat(widgets): product mini rows + paid list/card styles Product list mini/list compact DOM; paid posts style mini|list|card via shared post renderer; residual CSS for mini product/paid grids. --- assets/css/frontend/widget-batch5.css | 19 ++++++++++++++++ src/AKSRT/Core/WidgetAjax.php | 1 + src/AKSRT/Widgets/WidgetPaidPosts.php | 30 +++++++++++++++++++------ src/AKSRT/Widgets/WidgetProductList.php | 27 +++++++++++++++++----- 4 files changed, 65 insertions(+), 12 deletions(-) diff --git a/assets/css/frontend/widget-batch5.css b/assets/css/frontend/widget-batch5.css index 930abbf3..977feeca 100644 --- a/assets/css/frontend/widget-batch5.css +++ b/assets/css/frontend/widget-batch5.css @@ -2533,3 +2533,22 @@ a.main-color > .icon-cover-card:hover, .aksrt-plate-info .count-mates .em14 { font-weight: 700; line-height: 1.2; } .aksrt-fi[data-aksrt-feature-intro] .aksrt-fi__panel { display: none; } .aksrt-fi[data-aksrt-feature-intro] .aksrt-fi__panel.is-active { display: block; } + + +/* batch43-45 residual */ +.aksrt-product-widget__item--mini { + gap: 10px; padding: 8px 0; + border-bottom: 1px solid var(--color-line, rgba(0,0,0,.06)); +} +.aksrt-product-widget__item--mini:last-child { border-bottom: 0; } +.aksrt-product-widget__thumb.mini { + flex: 0 0 56px; width: 56px; height: 56px; border-radius: 8px; overflow: hidden; + background: var(--surface-2, #f3f4f6); display: block; +} +.aksrt-product-widget__thumb.mini img { width: 100%; height: 100%; object-fit: cover; display: block; } +.aksrt-paid-posts.style-card { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; } +.aksrt-paid-posts.style-list .aksrt-paid-posts__item { margin-bottom: 10px; } +.aksrt-paid-posts__price.badge { + display: inline-block; margin-top: 4px; padding: 1px 6px; border-radius: 4px; + background: rgba(240,68,148,.1); color: var(--theme-color, #f04494); font-size: 12px; +} diff --git a/src/AKSRT/Core/WidgetAjax.php b/src/AKSRT/Core/WidgetAjax.php index febe7a93..1a3cdbf8 100644 --- a/src/AKSRT/Core/WidgetAjax.php +++ b/src/AKSRT/Core/WidgetAjax.php @@ -134,6 +134,7 @@ class WidgetAjax { 'orderby' => sanitize_key((string) ($request->get_param('orderby') ?? 'date')), 'cat' => max(0, (int) ($request->get_param('cat') ?? 0)), 'limit_day' => max(0, (int) ($request->get_param('limit_day') ?? 0)), + 'style' => sanitize_key((string) ($request->get_param('style') ?? 'mini')), 'paginate' => $paginate, ]; $page = max(1, (int) ($request->get_param('page') ?? $request->get_param('paged') ?? 1)); diff --git a/src/AKSRT/Widgets/WidgetPaidPosts.php b/src/AKSRT/Widgets/WidgetPaidPosts.php index 6a790ef3..86e3c508 100644 --- a/src/AKSRT/Widgets/WidgetPaidPosts.php +++ b/src/AKSRT/Widgets/WidgetPaidPosts.php @@ -72,7 +72,7 @@ class WidgetPaidPosts extends \WP_Widget { return $query; } - public static function render_items_html(\WP_Query $q): string { + public static function render_items_html(\WP_Query $q, string $style = 'mini'): string { if (!$q->have_posts()) { return ''; } @@ -91,17 +91,18 @@ class WidgetPaidPosts extends \WP_Widget { } else { $badge = __('付费', 'aksrt'); } + $mode = in_array($style, ['list', 'card', 'mini'], true) ? $style : 'mini'; if (function_exists('aksrt_render_post')) { $item = aksrt_render_post([ - 'mode' => 'mini', + 'mode' => $mode, 'context' => 'widget', 'show_thumb' => true, 'show_meta' => true, - 'show_excerpt' => false, - 'extra_class' => 'ajax-item aksrt-paid-posts__mini', + 'show_excerpt' => $mode === 'list', + 'extra_class' => 'ajax-item aksrt-paid-posts__' . $mode, ]); if ($item !== '') { - echo '
'; + echo '
'; echo $item; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo '' . esc_html($badge) . ''; echo '
'; @@ -126,9 +127,13 @@ class WidgetPaidPosts extends \WP_Widget { $paginate = sanitize_key((string) ($instance['paginate'] ?? 'ajax')); $count = max(1, min(20, (int) ($instance['count'] ?? 6))); $q = new \WP_Query(self::build_query_args($instance, $page)); - $items = self::render_items_html($q); + $style = sanitize_key((string) ($instance['style'] ?? 'mini')); + if (!in_array($style, ['mini', 'list', 'card'], true)) { + $style = 'mini'; + } + $items = self::render_items_html($q, $style); $wrap_tag = (strpos($items, 'posts-mini') !== false || strpos($items, 'aksrt-paid-posts__mini') !== false) ? 'div' : 'ul'; - $html = $items !== '' ? '<' . $wrap_tag . ' class="aksrt-paid-posts">' . $items . '' : ''; + $html = $items !== '' ? '<' . $wrap_tag . ' class="aksrt-paid-posts style-' . esc_attr($style) . '">' . $items . '' : ''; if ($html === '' && $page === 1) { $html = function_exists('aksrt_get_ajax_null') ? aksrt_get_ajax_null(__('暂无付费内容', 'aksrt')) @@ -142,6 +147,7 @@ class WidgetPaidPosts extends \WP_Widget { 'orderby' => sanitize_key((string) ($instance['orderby'] ?? 'date')), 'cat' => max(0, (int) ($instance['cat'] ?? 0)), 'limit_day' => max(0, (int) ($instance['limit_day'] ?? 0)), + 'style' => $style, 'paginate' => $paginate, ], static function ($v) { return $v !== '' && $v !== null; @@ -203,6 +209,15 @@ class WidgetPaidPosts extends \WP_Widget {

+

+ +