refactor(autoload): migrate theme classes to Composer PSR-4
Move 288 types from global AKSRT_* + inc/classes manual requires into
namespace AKSRT\{Domain} under src/AKSRT/, wire composer.json psr-4,
and slim bootstrap to helpers/modules/hooks only. Split multi-class
widget/gateway files, update admin contract audit paths, and document
the layout in ADR/README.
This commit is contained in:
1 parent
8f349b40fb
commit
aaf458af1c
404 files changed
+13602
-7705
No files matched your search
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
if (class_exists('AKSRT_Settings') && !AKSRT_Settings::homepage_module_banner_enabled()) {
|
||||
if (class_exists('\AKSRT\Settings\Settings') && !\AKSRT\Settings\Settings::homepage_module_banner_enabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ $show_dates = !isset($cfg['show_dates']) || !empty($cfg['show_dates']);
|
||||
if (empty($cat_ids)) return;
|
||||
|
||||
// 懒加载配置
|
||||
$lazy_cfg = class_exists('AKSRT_Settings') ? AKSRT_Settings::get_lazyload_config() : ['enabled' => false, 'placeholder_url' => ''];
|
||||
$lazy_cfg = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_lazyload_config() : ['enabled' => false, 'placeholder_url' => ''];
|
||||
$lazy_on = !empty($lazy_cfg['enabled']);
|
||||
$placeholder = $lazy_cfg['placeholder_url'] ?: (get_template_directory_uri() . '/assets/img/placeholder.svg');
|
||||
|
||||
@@ -35,13 +35,13 @@ foreach ($cat_ids as $idx => $cat_id) {
|
||||
if (!$term || is_wp_error($term)) continue;
|
||||
|
||||
// 封面图
|
||||
$cover_url = class_exists('AKSRT_Settings')
|
||||
? AKSRT_Settings::get_category_cover_url($cat_id)
|
||||
$cover_url = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_category_cover_url($cat_id)
|
||||
: $placeholder;
|
||||
|
||||
// 分类描述(优先 term meta 推荐描述,其次原生 description)
|
||||
$desc = class_exists('AKSRT_Settings')
|
||||
? AKSRT_Settings::get_category_recommend_desc($cat_id)
|
||||
$desc = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_category_recommend_desc($cat_id)
|
||||
: (string) $term->description;
|
||||
|
||||
// 5 篇最新文章
|
||||
|
||||
@@ -18,7 +18,7 @@ if (!is_array($cfg)) {
|
||||
$hero_banners = function_exists('aksrt_get_banners') ? aksrt_get_banners(8, 'hero') : [];
|
||||
|
||||
$settings = function_exists('aksrt_get_all_settings') ? aksrt_get_all_settings() : [];
|
||||
$search_cfg = class_exists('AKSRT_Settings') ? AKSRT_Settings::get_header_components_search_config() : ['show' => false, 'keywords' => [], 'categories' => [], 'type_options' => []];
|
||||
$search_cfg = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_header_components_search_config() : ['show' => false, 'keywords' => [], 'categories' => [], 'type_options' => []];
|
||||
$show_search = !empty($search_cfg['show']) || !empty($cfg['with_search']);
|
||||
$show_cards = !empty($settings['header_components_cards_enabled']);
|
||||
$icon_cards = isset($settings['header_components_icon_cards']) ? (array) $settings['header_components_icon_cards'] : [];
|
||||
|
||||
Reference in new issue
Block a user