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
@@ -19,8 +19,8 @@ if (!is_user_logged_in()) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$messages_enabled = !class_exists('AKSRT_Settings') || AKSRT_Settings::message_enabled();
|
||||
$pm_settings = class_exists('AKSRT_Settings') ? AKSRT_Settings::private_message_settings() : ['enabled' => false];
|
||||
$messages_enabled = !class_exists('\AKSRT\Settings\Settings') || \AKSRT\Settings\Settings::message_enabled();
|
||||
$pm_settings = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::private_message_settings() : ['enabled' => false];
|
||||
$pm_enabled = !empty($pm_settings['enabled']);
|
||||
|
||||
if (!$messages_enabled) :
|
||||
@@ -114,9 +114,9 @@ foreach ($all_notifications as $n) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($pm_enabled && class_exists('AKSRT_Private_Message')) {
|
||||
if ($pm_enabled && class_exists('\AKSRT\Messages\PrivateMessage')) {
|
||||
// conversation count prefers live PM conversations when available
|
||||
$pm_tmp = AKSRT_Private_Message::get_instance();
|
||||
$pm_tmp = \AKSRT\Messages\PrivateMessage::get_instance();
|
||||
if (method_exists($pm_tmp, 'get_conversations')) {
|
||||
$convs = $pm_tmp->get_conversations($user_id, 100);
|
||||
if (is_array($convs)) {
|
||||
@@ -196,7 +196,7 @@ if (!$messages_base) {
|
||||
|
||||
<section class="messages-center__content">
|
||||
<?php if ($current_type === 'conversation' && $pm_enabled) :
|
||||
$pm = class_exists('AKSRT_Private_Message') ? AKSRT_Private_Message::get_instance() : null;
|
||||
$pm = class_exists('\AKSRT\Messages\PrivateMessage') ? \AKSRT\Messages\PrivateMessage::get_instance() : null;
|
||||
$conversations = $pm ? $pm->get_conversations($user_id, 30) : [];
|
||||
$pm_nonce = wp_create_nonce('aksrt_pm');
|
||||
$pm_placeholder = (string) ($pm_settings['placeholder'] ?? __('请输入消息...', 'aksrt'));
|
||||
|
||||
Reference in new issue
Block a user