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:
+9
-9
@@ -7,8 +7,8 @@
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
$aksrt_header_settings = class_exists('AKSRT_Settings')
|
||||
? AKSRT_Settings::get_header_nav_settings()
|
||||
$aksrt_header_settings = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_header_nav_settings()
|
||||
: [
|
||||
'fixed' => true,
|
||||
'search_enabled' => true,
|
||||
@@ -24,8 +24,8 @@ $aksrt_header_settings = class_exists('AKSRT_Settings')
|
||||
];
|
||||
|
||||
$aksrt_initial_theme_mode = '';
|
||||
if (class_exists('AKSRT_Settings') && method_exists('AKSRT_Settings', 'initial_theme_mode')) {
|
||||
$aksrt_initial_theme_mode = AKSRT_Settings::initial_theme_mode();
|
||||
if (class_exists('\AKSRT\Settings\Settings') && method_exists('\AKSRT\Settings\Settings', 'initial_theme_mode')) {
|
||||
$aksrt_initial_theme_mode = \AKSRT\Settings\Settings::initial_theme_mode();
|
||||
}
|
||||
$aksrt_has_initial_theme = in_array($aksrt_initial_theme_mode, ['dark', 'light'], true);
|
||||
|
||||
@@ -52,7 +52,7 @@ $aksrt_body_classes[] = 'mobile-header-' . $aksrt_header_settings['mobile_layout
|
||||
$aksrt_body_classes[] = 'mobile-nav-' . $aksrt_header_settings['mobile_align'];
|
||||
|
||||
// 全局背景系统
|
||||
$aksrt_bg_settings = class_exists('AKSRT_Settings') ? AKSRT_Settings::get_global_background_settings() : [];
|
||||
$aksrt_bg_settings = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_global_background_settings() : [];
|
||||
$aksrt_bg_styles = [];
|
||||
if (!empty($aksrt_bg_settings['bg_color'])) {
|
||||
$aksrt_bg_styles[] = '--aksrt-bg-color:' . sanitize_hex_color($aksrt_bg_settings['bg_color']);
|
||||
@@ -128,7 +128,7 @@ if (!empty($aksrt_bg_styles)) {
|
||||
$aksrt_show_user_entry = !empty($aksrt_header_settings['user_menu']);
|
||||
$aksrt_current_user = wp_get_current_user();
|
||||
$aksrt_user_credit = function_exists('aksrt_user_credits') && is_user_logged_in() ? (int) aksrt_user_credits(get_current_user_id()) : 0;
|
||||
$aksrt_currency_name = class_exists('AKSRT_Settings') ? AKSRT_Settings::get_currency_name() : __('积分', 'aksrt');
|
||||
$aksrt_currency_name = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_currency_name() : __('积分', 'aksrt');
|
||||
$aksrt_orders_url = function_exists('aksrt_get_orders_page_url') ? aksrt_get_orders_page_url() : '';
|
||||
$aksrt_publish_url = admin_url('post-new.php');
|
||||
$aksrt_messages_url = function_exists('aksrt_get_messages_page_url') ? aksrt_get_messages_page_url() : '';
|
||||
@@ -147,12 +147,12 @@ if (!empty($aksrt_bg_styles)) {
|
||||
$aksrt_theme_settings_url = function_exists('aksrt_get_admin_settings_url')
|
||||
? aksrt_get_admin_settings_url('')
|
||||
: admin_url('admin.php?page=aksrt-settings');
|
||||
$aksrt_theme_toggle_positions = class_exists('AKSRT_Settings')
|
||||
? AKSRT_Settings::get_theme_mode_button_positions()
|
||||
$aksrt_theme_toggle_positions = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_theme_mode_button_positions()
|
||||
: ['pc_nav', 'm_menu'];
|
||||
$aksrt_can_publish = !empty($aksrt_header_settings['publish_btn']) && (
|
||||
current_user_can('manage_options')
|
||||
|| (class_exists('AKSRT_Front_Submit') && AKSRT_Front_Submit::get_instance()->can_submit())
|
||||
|| (class_exists('\AKSRT\Core\FrontSubmit') && \AKSRT\Core\FrontSubmit::get_instance()->can_submit())
|
||||
);
|
||||
$aksrt_show_header_slide = function_exists('aksrt_header_slide_is_show')
|
||||
? aksrt_header_slide_is_show()
|
||||
|
||||
Reference in New Issue
Block a user