Compare commits

...
2 Commits
Author SHA1 Message Date
kate522 ff7b1c547a Merge pull request 'fix(widgets): keep found rows for term aggregation post count' (#25) from worktree/fix-term-aggregation-cover into main
Reviewed-on: #25
2026-09-05 04:32:50 +00:00
kate522 0c4a0d18f4 fix(widgets): keep found rows for term aggregation post count
The aggregation card's N篇文章 meta reads found_posts, but paginate ''
disables SQL_CALC_FOUND_ROWS and found_posts comes back 0 on current
WordPress. The reference shows the term's total post count, so keep
found rows enabled for this internal query.
2026-09-05 12:32:09 +08:00
+3 -1
View File
@@ -235,7 +235,9 @@ if (!function_exists('aksrt_widget_term_aggregation')) :
'orderby' => (string) $args['orderby'], 'orderby' => (string) $args['orderby'],
'order' => strtoupper((string) $args['order']) === 'ASC' ? 'ASC' : 'DESC', 'order' => strtoupper((string) $args['order']) === 'ASC' ? 'ASC' : 'DESC',
'count' => max(1, (int) $args['count']), 'count' => max(1, (int) $args['count']),
'paginate' => '', // The reference shows the term's total post count, so found rows
// must stay enabled (paginate '' would disable them).
'paginate' => 'number',
]; ];
$query = \AKSRT\WidgetSystem\PostQuery::build($query_args, 1, []); $query = \AKSRT\WidgetSystem\PostQuery::build($query_args, 1, []);