refactor: flatten src/AKSRT → src (drop theme-identifier dir)
Move all domain folders from src/AKSRT/{Domain} to src/{Domain}; remap
Composer PSR-4 "AKSRT\\": "src/"; update audit script + README + ADR
paths; remove dead tools/build-psr4-map.php (scanned deleted inc/classes).
This commit is contained in:
@@ -0,0 +1,152 @@
|
||||
<?php
|
||||
/**
|
||||
* @package AKSRT
|
||||
*/
|
||||
|
||||
namespace AKSRT\Settings;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
trait CategoryIntegrationGroups {
|
||||
|
||||
/**
|
||||
* 获取分类推荐配置(含默认值)
|
||||
* @return array
|
||||
*/
|
||||
public static function get_category_recommend_settings(): array {
|
||||
return CategoryRuntime::get_category_recommend_settings();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分类封面图 URL(带优先级回退)
|
||||
*
|
||||
* 优先级:
|
||||
* 1. aksrt_category_cover_id term meta
|
||||
* 2. 该分类最新一篇有缩略图文章的缩略图
|
||||
* 3. 默认占位图
|
||||
*/
|
||||
public static function get_category_cover_url(int $term_id): string {
|
||||
return CategoryRuntime::get_category_cover_url($term_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分类推荐描述(带优先级回退)
|
||||
*
|
||||
* 优先级:
|
||||
* 1. aksrt_category_recommend_desc term meta
|
||||
* 2. 原生 category description
|
||||
* 3. 空字符串
|
||||
*/
|
||||
public static function get_category_recommend_desc(int $term_id): string {
|
||||
return CategoryRuntime::get_category_recommend_desc($term_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理分类推荐缓存
|
||||
*/
|
||||
public static function flush_category_recommend_cache(): void {
|
||||
CategoryRuntime::flush_category_recommend_cache();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分类推荐渲染数据(带缓存)
|
||||
*
|
||||
* @param array $settings 分类推荐配置
|
||||
* @return array 每项包含 term_id, name, description, count, link, cover, posts
|
||||
*/
|
||||
public static function get_category_recommend_items(array $settings): array {
|
||||
return CategoryRuntime::get_category_recommend_items($settings);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取底部Tab完整配置
|
||||
* @return array {enabled, scroll_hide, scroll_down_hide, items}
|
||||
*/
|
||||
public static function get_footer_tabbar_settings(): array {
|
||||
return Integration::get_footer_tabbar_settings();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取底部Tab项(仅返回启用的,按排序)
|
||||
* @return array
|
||||
*/
|
||||
public static function get_footer_tabbar_items(): array {
|
||||
return Integration::get_footer_tabbar_items();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文章页专属Tab模式
|
||||
* @return string 'default' | 'extend'
|
||||
*/
|
||||
public static function get_footer_tabbar_single(): string {
|
||||
return Integration::get_footer_tabbar_single();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取通知系统设置
|
||||
* @return array {read_retention_days, unread_retention_days, max_per_user}
|
||||
*/
|
||||
public static function get_notification_settings(): array {
|
||||
return Integration::get_notification_settings();
|
||||
}
|
||||
|
||||
/** 单项通知是否启用 */
|
||||
public static function notification_enabled(string $type): bool {
|
||||
return Integration::notification_enabled($type);
|
||||
}
|
||||
|
||||
/** user 徽标是否启用 */
|
||||
public static function notification_user_badge_enabled(): bool {
|
||||
return Integration::notification_user_badge_enabled();
|
||||
}
|
||||
|
||||
/** user 徽标是否包含即时提醒 */
|
||||
public static function notification_badge_include_stateful(): bool {
|
||||
return Integration::notification_badge_include_stateful();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取右侧浮动按钮完整配置
|
||||
* @return array {enabled, style, position, scroll_hide, scroll_down_hide, filter_blur, items}
|
||||
*/
|
||||
public static function get_floating_buttons_settings(): array {
|
||||
return Integration::get_floating_buttons_settings();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取右侧浮动按钮项(仅返回启用的,按排序)
|
||||
* @return array
|
||||
*/
|
||||
public static function get_floating_buttons_items(): array {
|
||||
return Integration::get_floating_buttons_items();
|
||||
}
|
||||
|
||||
/**
|
||||
* Customizer 注册(可选)
|
||||
*/
|
||||
public function customizer(\WP_Customize_Manager $wp_customize): void {
|
||||
$wp_customize->add_setting('blogname', ['default' => get_bloginfo('name'), 'type' => 'option']);
|
||||
|
||||
$wp_customize->add_setting('aksrt_logo', [
|
||||
'default' => '',
|
||||
'sanitize_callback' => 'esc_url_raw',
|
||||
'transport' => 'postMessage',
|
||||
]);
|
||||
$wp_customize->add_control(new \WP_Customize_Image_Control(
|
||||
$wp_customize,
|
||||
'aksrt_logo',
|
||||
['label' => __('Logo', 'aksrt'), 'section' => 'title_tagline']
|
||||
));
|
||||
|
||||
$wp_customize->add_setting('aksrt_favicon', [
|
||||
'default' => '',
|
||||
'sanitize_callback' => 'esc_url_raw',
|
||||
'transport' => 'postMessage',
|
||||
]);
|
||||
$wp_customize->add_control(new \WP_Customize_Upload_Control(
|
||||
$wp_customize,
|
||||
'aksrt_favicon',
|
||||
['label' => __('Favicon', 'aksrt'), 'section' => 'title_tagline']
|
||||
));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user