feat(homepage): consume Zibll homepage keys on frontend queries
Point homepage getters and tab queries at home_lists / home_exclude_* / index_list_title / list1 orderby. Support category+topics tab terms via tax_query, expand the homepage term picker API, and keep facade method names for existing templates without dual-writing storage keys.
This commit is contained in:
1 parent
0c882d8887
commit
f0f6e97d04
4 files changed
+76
-15
No files matched your search
@@ -97,10 +97,13 @@ if (!function_exists('aksrt_homepage_get_tab_terms')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$term = get_term($tab['term_id'], 'category');
|
||||
$term = get_term($tab['term_id']);
|
||||
if (!$term || is_wp_error($term)) {
|
||||
continue;
|
||||
}
|
||||
if (!in_array($term->taxonomy, ['category', 'topics'], true)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$configs[] = [
|
||||
'term' => $term,
|
||||
@@ -436,6 +439,12 @@ if (!function_exists('aksrt_homepage_get_tab_query')) {
|
||||
return $queries[$cache_key];
|
||||
}
|
||||
|
||||
$term = get_term($term_id);
|
||||
$taxonomy = ($term && !is_wp_error($term)) ? (string) $term->taxonomy : 'category';
|
||||
if (!in_array($taxonomy, ['category', 'topics'], true)) {
|
||||
$taxonomy = 'category';
|
||||
}
|
||||
|
||||
$query_args = [
|
||||
'post_type' => aksrt_homepage_get_post_types(),
|
||||
'post_status' => 'publish',
|
||||
@@ -445,8 +454,14 @@ if (!function_exists('aksrt_homepage_get_tab_query')) {
|
||||
'ignore_sticky_posts' => true,
|
||||
'orderby' => 'date',
|
||||
'order' => 'DESC',
|
||||
'cat' => $term_id,
|
||||
'no_found_rows' => true,
|
||||
'tax_query' => [
|
||||
[
|
||||
'taxonomy' => $taxonomy,
|
||||
'field' => 'term_id',
|
||||
'terms' => [$term_id],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
$exclude_ids = class_exists('AKSRT_Settings')
|
||||
|
||||
Reference in new issue
Block a user