fix(theme): align reference layouts and restore passing contracts
Align homepage and category discovery, modern widgets, admin controls, quotes, and comments with the reference theme. Remove superseded paths and add rendering and behavior coverage. Update stale asset and finance contracts; all 760 Node tests and 139 widget assertions pass.
This commit is contained in:
1 parent
b520d29368
commit
8aa116ec43
63 files changed
+1985
-2304
No files matched your search
@@ -100,12 +100,12 @@ if (!function_exists('aksrt_archive_get_sort_state')) :
|
||||
$lists = array_values(array_unique(array_merge($lists, $all)));
|
||||
}
|
||||
|
||||
$current = isset($_GET['orderby']) ? sanitize_key(wp_unslash((string) $_GET['orderby'])) : 'date';
|
||||
if (!in_array($current, $all, true)) {
|
||||
$current = isset($_GET['orderby']) ? sanitize_key(wp_unslash((string) $_GET['orderby'])) : '';
|
||||
if ($current !== '' && !in_array($current, $all, true)) {
|
||||
$current = 'date';
|
||||
}
|
||||
|
||||
$base_url = remove_query_arg(['orderby', 'order', 'paged']);
|
||||
$base_url = remove_query_arg(['orderby', 'order'], aksrt_homepage_url_del_paged(aksrt_homepage_get_current_url()));
|
||||
$links = [];
|
||||
foreach ($lists as $orderby) {
|
||||
$links[$orderby] = add_query_arg('orderby', $orderby, $base_url);
|
||||
@@ -176,12 +176,12 @@ if (!function_exists('aksrt_archive_render_stream')) :
|
||||
'query_context' => 'archive',
|
||||
'empty_text' => __('暂无文章', 'aksrt'),
|
||||
'stream_class' => '',
|
||||
'ajax_enabled' => false,
|
||||
'ajax_attrs' => '',
|
||||
'filter_html' => '',
|
||||
]);
|
||||
|
||||
$classes = [
|
||||
'content-stream',
|
||||
'content-stream', 'posts-row', 'ajaxpager',
|
||||
'content-stream--' . sanitize_html_class((string) $args['page_kind']),
|
||||
];
|
||||
if (!empty($args['stream_class'])) {
|
||||
@@ -192,9 +192,6 @@ if (!function_exists('aksrt_archive_render_stream')) :
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($args['ajax_enabled'])) {
|
||||
$classes[] = 'is-ajax-enabled';
|
||||
}
|
||||
|
||||
$mode = (string) ($render_config['mode'] ?? 'list');
|
||||
$has_posts = $query instanceof WP_Query ? $query->have_posts() : have_posts();
|
||||
@@ -204,12 +201,9 @@ if (!function_exists('aksrt_archive_render_stream')) :
|
||||
data-page-kind="<?php echo esc_attr((string) $args['page_kind']); ?>"
|
||||
data-render-mode="<?php echo esc_attr($mode); ?>"
|
||||
data-list-type="<?php echo esc_attr((string) ($render_config['list_type'] ?? 'thumb')); ?>"
|
||||
<?php if (!empty($args['ajax_enabled'])) : ?>
|
||||
data-ajax-wrap
|
||||
data-query-context="<?php echo esc_attr((string) $args['query_context']); ?>"
|
||||
<?php endif; ?>
|
||||
<?php echo $args['ajax_attrs']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
>
|
||||
<?php echo $args['filter_html']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php if ($has_posts) : ?>
|
||||
<?php
|
||||
// legacy 契约:分页渲染在 .ajaxpager 内部(zib_paging 位置),
|
||||
@@ -222,7 +216,7 @@ if (!function_exists('aksrt_archive_render_stream')) :
|
||||
$pagination_html = (string) ob_get_clean();
|
||||
|
||||
// 归档面与首页共用同一套骨架契约:.post_ajax_loader + .is-loading。
|
||||
// 挂在分页之后(列表末尾),archive.js 靠它在 wrap 内定位加载态。
|
||||
// 挂在分页之后(列表末尾),通用列表运行时在 pager 内定位加载态。
|
||||
$loader_html = '<div class="post_ajax_loader" role="status" aria-label="'
|
||||
. esc_attr__('正在加载', 'aksrt') . '">'
|
||||
. aksrt_render_placeholder(
|
||||
@@ -232,14 +226,12 @@ if (!function_exists('aksrt_archive_render_stream')) :
|
||||
. '</div>';
|
||||
|
||||
aksrt_render_post_list(array_merge($render_config, [
|
||||
'wrapper_class' => 'content-stream__list',
|
||||
'skip_wrapper' => true,
|
||||
'append_inner_html' => $pagination_html . $loader_html,
|
||||
]), $query);
|
||||
?>
|
||||
<?php else : ?>
|
||||
<div class="no-results content-stream__empty">
|
||||
<p><?php echo esc_html((string) $args['empty_text']); ?></p>
|
||||
</div>
|
||||
<div class="ajax-item"><?php echo aksrt_get_null((string) $args['empty_text'], 100, 'null-post.svg'); ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
Reference in new issue
Block a user