登录注册体系的源码级硬切换
This commit is contained in:
@@ -13,9 +13,7 @@ if (!function_exists('aksrt_get_user_notifications')) :
|
||||
/**
|
||||
* 获取用户提醒列表(即时提醒,不持久化)
|
||||
*
|
||||
* 当前通知源:
|
||||
* - 邮箱待验证
|
||||
* - 评论待审核
|
||||
* 当前通知源:评论待审核。
|
||||
*
|
||||
* @param int $user_id 用户 ID,默认当前用户
|
||||
* @return array<int, array{type:string,title:string,desc:string,url:string,count:int}>
|
||||
@@ -28,21 +26,6 @@ function aksrt_get_user_notifications(int $user_id = 0): array {
|
||||
|
||||
$items = [];
|
||||
|
||||
$email_verified = true;
|
||||
if (class_exists('\AKSRT\Auth\Service')) {
|
||||
$email_verified = \AKSRT\Auth\Service::user_is_email_verified($user_id);
|
||||
}
|
||||
|
||||
if (!$email_verified && (!class_exists('\AKSRT\Settings\Settings') || \AKSRT\Settings\Settings::notification_enabled('verify_email'))) {
|
||||
$items[] = [
|
||||
'type' => 'verify_email',
|
||||
'title' => __('邮箱待验证', 'aksrt'),
|
||||
'desc' => __('请尽快完成邮箱验证,部分功能需要验证后才能使用。', 'aksrt'),
|
||||
'url' => function_exists('aksrt_get_verify_email_url') ? aksrt_get_verify_email_url($user_id) : home_url('/'),
|
||||
'count' => 1,
|
||||
];
|
||||
}
|
||||
|
||||
$pending_comments = (int) get_comments([
|
||||
'user_id' => $user_id,
|
||||
'count' => true,
|
||||
@@ -72,7 +55,6 @@ function aksrt_notification_type_label(string $type): string {
|
||||
'download_ready' => __('下载就绪', 'aksrt'),
|
||||
'credits_added' => __('积分增加', 'aksrt'),
|
||||
'credits_deducted' => __('积分扣减', 'aksrt'),
|
||||
'verify_email' => __('邮箱验证', 'aksrt'),
|
||||
'pending_comments' => __('待审核评论', 'aksrt'),
|
||||
'notice' => __('通知', 'aksrt'),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user