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
@@ -21,8 +21,8 @@ if (!function_exists('aksrt_comments_template_query_args')) :
|
||||
? sanitize_key((string) wp_unslash($_GET['aksrt_comment_order']))
|
||||
: '';
|
||||
if ($order === '') {
|
||||
$settings = class_exists('AKSRT_Settings')
|
||||
? AKSRT_Settings::get_comment_display_settings()
|
||||
$settings = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_comment_display_settings()
|
||||
: [];
|
||||
$order = (($settings['order'] ?? 'desc') === 'asc') ? 'oldest' : 'newest';
|
||||
}
|
||||
@@ -70,8 +70,8 @@ if (!function_exists('aksrt_comments_build_context')) :
|
||||
* @return array<string,mixed>
|
||||
*/
|
||||
function aksrt_comments_build_context(): array {
|
||||
$settings = class_exists('AKSRT_Settings')
|
||||
? AKSRT_Settings::get_comment_display_settings()
|
||||
$settings = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_comment_display_settings()
|
||||
: [
|
||||
'order' => 'desc',
|
||||
'nested_depth' => 3,
|
||||
@@ -115,8 +115,8 @@ if (!function_exists('aksrt_comments_build_context')) :
|
||||
'submit_text' => (string) ($settings['submit_text'] ?? __('提交评论', 'aksrt')),
|
||||
'title_text' => (string) ($settings['title'] ?? __('评论', 'aksrt')),
|
||||
'corderby_enabled' => !empty($settings['corderby']),
|
||||
'oauth_providers' => class_exists('AKSRT_OAuth')
|
||||
? AKSRT_OAuth::get_instance()->get_auth_providers_data()
|
||||
'oauth_providers' => class_exists('\AKSRT\Auth\OAuth')
|
||||
? \AKSRT\Auth\OAuth::get_instance()->get_auth_providers_data()
|
||||
: [],
|
||||
];
|
||||
}
|
||||
@@ -150,8 +150,8 @@ if (!function_exists('aksrt_comments_normalize_order')) :
|
||||
function aksrt_comments_normalize_order(string $order = ''): string {
|
||||
$order = sanitize_key($order);
|
||||
if (!in_array($order, ['newest', 'oldest', 'hottest'], true)) {
|
||||
$settings = class_exists('AKSRT_Settings')
|
||||
? AKSRT_Settings::get_comment_display_settings()
|
||||
$settings = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_comment_display_settings()
|
||||
: [];
|
||||
$order = (($settings['order'] ?? 'desc') === 'asc') ? 'oldest' : 'newest';
|
||||
}
|
||||
@@ -169,8 +169,8 @@ if (!function_exists('aksrt_comments_query_for_post')) :
|
||||
* @return array{comments:array<int,\WP_Comment>,total:int,max_pages:int,page:int,order:string,author_only:bool,settings:array}
|
||||
*/
|
||||
function aksrt_comments_query_for_post(int $post_id, array $args = []): array {
|
||||
$settings = class_exists('AKSRT_Settings')
|
||||
? AKSRT_Settings::get_comment_display_settings()
|
||||
$settings = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_comment_display_settings()
|
||||
: [];
|
||||
$order = aksrt_comments_normalize_order((string) ($args['order'] ?? ''));
|
||||
$author_only = !empty($args['author_only']);
|
||||
|
||||
Reference in new issue
Block a user