Files
wordpress-theme-aksrt/inc/classes/settings/trait-aksrt-settings-homepage-reader.php
T

252 lines
7.4 KiB
PHP

<?php
defined('ABSPATH') || exit;
trait AKSRT_Settings_Homepage_Reader {
/**
* Allowed sort/orderby values for the homepage.
*
* @return string[]
*/
public static function homepage_allowed_sorts(): array {
return AKSRT_Settings_Home_Cms::homepage_allowed_sorts();
}
/**
* Full sort label map for admin UI and front-end rendering.
*
* @return array<string,string>
*/
public static function homepage_sort_labels(): array {
return AKSRT_Settings_Home_Cms::homepage_sort_labels();
}
/**
* Fixed homepage visual settings.
*
* @return array<string,mixed>
*/
public static function get_homepage_fixed_settings(): array {
return AKSRT_Settings_Home_Cms::get_homepage_fixed_settings();
}
/**
* Homepage always uses ordinary posts.
*
* @return string Always 'post'.
*/
public static function homepage_content_model(): string {
return AKSRT_Settings_Home_Cms::homepage_content_model();
}
/**
* Structured homepage tabs.
*
* @return array<int, array{term_id:int, title:string, orderby:string, enabled:bool}>
*/
public static function homepage_tabs(): array {
return AKSRT_Settings_Home_Cms::homepage_tabs();
}
/**
* Homepage card view variant.
*
* @return string default|style2|style3
*/
public static function homepage_card_style(): string {
return AKSRT_Settings_Home_Cms::homepage_card_style();
}
/**
* Whether homepage list cards should switch to the multi-thumb layout.
*/
public static function homepage_multi_thumb_enabled(): bool {
return AKSRT_Settings_Home_Cms::homepage_multi_thumb_enabled();
}
/**
* Minimum image count required to trigger the multi-thumb layout.
*/
public static function homepage_multi_thumb_min_images(): int {
return AKSRT_Settings_Home_Cms::homepage_multi_thumb_min_images();
}
/**
* Whether homepage sidebar widgets should use the compact mini list style.
*/
public static function homepage_sidebar_mini_enabled(): bool {
return AKSRT_Settings_Home_Cms::homepage_sidebar_mini_enabled();
}
/**
* Default homepage sort mode when no query override is present.
*/
public static function homepage_default_sort(): string {
return AKSRT_Settings_Home_Cms::homepage_default_sort();
}
/**
* Default homepage view mode.
*/
public static function homepage_default_view(): string {
return AKSRT_Settings_Home_Cms::homepage_default_view();
}
/**
* Whether the homepage sortbar should refresh through AJAX.
*/
public static function homepage_sort_ajax_enabled(): bool {
return AKSRT_Settings_Home_Cms::homepage_sort_ajax_enabled();
}
/**
* Whether the homepage tabs should use sticky/affix behaviour.
*/
public static function homepage_sticky_tabs_enabled(): bool {
return AKSRT_Settings_Home_Cms::homepage_sticky_tabs_enabled();
}
/**
* Whether the main "latest posts" list is enabled on the homepage.
*/
public static function home_posts_list_enabled(): bool {
return AKSRT_Settings_Home_Cms::home_posts_list_enabled();
}
/**
* Custom title for the main homepage list section.
*/
public static function home_list_title(): string {
return AKSRT_Settings_Home_Cms::home_list_title();
}
/**
* Whether the sort bar is enabled for the main stream.
*/
public static function home_list_sort_enabled(): bool {
return AKSRT_Settings_Home_Cms::home_list_sort_enabled();
}
/**
* Configured sort option keys for the main stream sort bar.
*
* @return string[]
*/
public static function home_list_sort_options(): array {
return AKSRT_Settings_Home_Cms::home_list_sort_options();
}
/**
* Whether the sort bar uses a dropdown instead of inline links.
*/
public static function home_list_sort_dropdown(): bool {
return AKSRT_Settings_Home_Cms::home_list_sort_dropdown();
}
/**
* Post IDs excluded from both main stream and tab queries.
*
* @return int[]
*/
public static function home_exclude_post_ids(): array {
return AKSRT_Settings_Home_Cms::home_exclude_post_ids();
}
/**
* Category IDs excluded from the main stream.
*
* @return int[]
*/
public static function home_exclude_category_ids(): array {
return AKSRT_Settings_Home_Cms::home_exclude_category_ids();
}
/**
* Posts per page for each category tab.
*/
public static function homepage_tab_posts_per_page(): int {
return AKSRT_Settings_Home_Cms::homepage_tab_posts_per_page();
}
/**
* Maximum number of category tabs to display.
*/
public static function homepage_tab_limit(): int {
return AKSRT_Settings_Home_Cms::homepage_tab_limit();
}
// ============================================
// 顶部多功能组件设置(图标卡片 + 搜索覆盖)
// ============================================
/**
* 是否显示顶部组件搜索覆盖框
*/
public static function header_components_search_enabled(): bool {
return AKSRT_Settings_Display_Runtime::header_components_search_enabled();
}
/**
* 顶部组件搜索详细配置(PC/移动分别 + 子选项)
*
* @return array{pc:bool,mobile:bool,show_keywords:bool,popular_limit:int,show_input_cat:bool,show_type:bool,keywords:string[],categories:array,type_options:array}
*/
public static function get_header_components_search_config(): array {
return AKSRT_Settings_Display_Runtime::get_header_components_search_config();
}
/**
* 是否显示顶部组件图标卡片覆盖
*/
public static function header_components_cards_enabled(): bool {
return AKSRT_Settings_Display_Runtime::header_components_cards_enabled();
}
/**
* 获取顶部组件图标卡片配置
* @return array
*/
public static function homepage_module_hero_enabled(): bool {
return AKSRT_Settings_Display_Runtime::homepage_module_hero_enabled();
}
public static function homepage_module_banner_enabled(): bool {
return AKSRT_Settings_Display_Runtime::homepage_module_banner_enabled();
}
/**
* Global slider configuration shared by Hero and Banner.
*
* @return array<string,mixed>
*/
public static function get_slider_config(): array {
return AKSRT_Settings_Display_Runtime::get_slider_config();
}
public static function get_header_components_icon_cards(): array {
return AKSRT_Settings_Display_Runtime::get_header_components_icon_cards();
}
/**
* 获取顶部组件卡片列数
*/
public static function get_header_components_card_columns(): int {
return AKSRT_Settings_Display_Runtime::get_header_components_card_columns();
}
/**
* 是否显示顶部组件卡片背景色
*/
public static function header_components_card_bg_enabled(): bool {
return AKSRT_Settings_Display_Runtime::header_components_card_bg_enabled();
}
/**
* 获取页脚配色配置
*/
public static function get_footer_theme_config(): array {
return AKSRT_Settings_Home_Cms::get_footer_theme_config();
}
}