fix(list): wire Zibll list/card display chain end-to-end
Resolve post list mode from global list_type + surface card overrides so homepage/archives/AJAX honor admin list and card style settings.
This commit is contained in:
1 parent
b2815614d1
commit
d73a7af25e
17 files changed
+444
-151
No files matched your search
@@ -84,19 +84,24 @@ class AKSRT_Term_Meta {
|
||||
$saved = [];
|
||||
}
|
||||
|
||||
$layout_mode = isset($saved['layout_mode']) && $saved['layout_mode'] !== ''
|
||||
? sanitize_key((string) $saved['layout_mode'])
|
||||
: (string) ($global['list_mode'] ?? 'grid');
|
||||
|
||||
$layout_map = [
|
||||
'grid' => ['mode' => 'card', 'card_style' => 'standard'],
|
||||
'card' => ['mode' => 'card', 'card_style' => 'standard'],
|
||||
'list' => ['mode' => 'list', 'card_style' => 'standard'],
|
||||
'compact' => ['mode' => 'list', 'card_style' => 'compact'],
|
||||
'mini' => ['mode' => 'mini', 'card_style' => 'standard'],
|
||||
'grid-cms' => ['mode' => 'grid-cms', 'card_style' => 'standard'],
|
||||
];
|
||||
$resolved_layout = $layout_map[$layout_mode] ?? ['mode' => 'card', 'card_style' => 'standard'];
|
||||
// Empty term layout_mode means follow global post-list settings (Zibll).
|
||||
// Do not fall back to page-display list_mode=grid which forced card everywhere.
|
||||
$layout_preset = isset($saved['layout_mode']) ? sanitize_key((string) $saved['layout_mode']) : '';
|
||||
if ($layout_preset === '') {
|
||||
$resolved_layout = ['mode' => '', 'card_style' => ''];
|
||||
$layout_mode = '';
|
||||
} else {
|
||||
$layout_mode = $layout_preset;
|
||||
$layout_map = [
|
||||
'grid' => ['mode' => 'card', 'card_style' => 'thumb'],
|
||||
'card' => ['mode' => 'card', 'card_style' => 'thumb'],
|
||||
'list' => ['mode' => 'list', 'card_style' => 'thumb'],
|
||||
'compact' => ['mode' => 'list', 'card_style' => 'compact'],
|
||||
'mini' => ['mode' => 'mini', 'card_style' => 'thumb'],
|
||||
'grid-cms' => ['mode' => 'grid-cms', 'card_style' => 'thumb'],
|
||||
];
|
||||
$resolved_layout = $layout_map[$layout_mode] ?? ['mode' => 'list', 'card_style' => 'thumb'];
|
||||
}
|
||||
|
||||
$header_style = (string) ($global['header_style'] ?? 'simple');
|
||||
if (!in_array($header_style, ['cover', 'simple', 'none'], true)) {
|
||||
|
||||
Reference in new issue
Block a user