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
@@ -104,7 +104,6 @@ class HomeCms {
|
||||
|
||||
public static function get_homepage_fixed_settings(): array {
|
||||
$s = Settings::read_domain('page_display', 'homepage');
|
||||
$allowed_sorts = self::homepage_allowed_sorts();
|
||||
|
||||
// Canonical legacy-aligned primary list contract.
|
||||
$main_list_enabled = !array_key_exists('home_posts_list_s', $s) || !empty($s['home_posts_list_s']);
|
||||
@@ -113,19 +112,11 @@ class HomeCms {
|
||||
$orderby_option = isset($s['home_list1_orderby_option']) && is_array($s['home_list1_orderby_option'])
|
||||
? $s['home_list1_orderby_option']
|
||||
: [];
|
||||
$sort_options_raw = $orderby_option['lists'] ?? [];
|
||||
$sort_options_raw = $orderby_option['lists'] ?? ['modified', 'views', 'like', 'comment_count'];
|
||||
if (!is_array($sort_options_raw)) {
|
||||
$sort_options_raw = [];
|
||||
}
|
||||
$sort_options = self::normalize_sort_options($sort_options_raw);
|
||||
$default_sort = sanitize_key((string) ($sort_options[0] ?? 'modified'));
|
||||
if (!in_array($default_sort, $allowed_sorts, true)) {
|
||||
$default_sort = 'modified';
|
||||
}
|
||||
if (!in_array($default_sort, $sort_options, true)) {
|
||||
array_unshift($sort_options, $default_sort);
|
||||
$sort_options = array_values(array_unique($sort_options));
|
||||
}
|
||||
|
||||
$list_title = wp_kses_post((string) ($s['index_list_title'] ?? ''));
|
||||
|
||||
@@ -171,8 +162,7 @@ class HomeCms {
|
||||
}
|
||||
|
||||
public static function homepage_default_sort(): string {
|
||||
$settings = self::get_homepage_fixed_settings();
|
||||
return $settings['home_list1_orderby_option']['lists'][0] ?? 'modified';
|
||||
return 'date';
|
||||
}
|
||||
|
||||
public static function home_posts_list_enabled(): bool {
|
||||
@@ -223,10 +213,6 @@ class HomeCms {
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($result)) {
|
||||
$result = ['modified', 'views', 'like', 'comment_count'];
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user