feat(vip): Batch 3 dedicated user-center VIP tab

Register 我的会员 panel, zibll-style status/equity cards, sidebar deep-link,
and slim credits-tab entry so VIP is no longer nested only under assets.
This commit is contained in:
kate522 committed 2026-07-21 17:09:23 +08:00
1 parent 965032f2e9
commit 1f87ab3b1b
8 files changed
+209 -5

No files matched your search

+20
View File
@@ -73,6 +73,12 @@ class Center {
'priority' => 50,
'type' => 'panel',
],
'vip' => [
'label' => __('我的会员', 'aksrt'),
'icon' => 'crown',
'priority' => 45,
'type' => 'panel',
],
'notif' => [
'label' => __('消息通知', 'aksrt'),
'icon' => 'bell',
@@ -119,12 +125,26 @@ class Center {
$this->panels['credits'] = $panel;
}
// Dedicated VIP tab when membership is enabled.
$vip_on = class_exists('\AKSRT\Settings\Settings')
&& !empty(\AKSRT\Settings\Settings::get_payment_vip_settings()['enabled']);
if ($vip_on && !isset($this->panels['vip'])) {
$this->panels['vip'] = $definitions['vip'];
} elseif (!$vip_on && isset($this->panels['vip'])) {
unset($this->panels['vip']);
}
if (!isset($this->panels['settings'])) {
$this->panels['settings'] = $definitions['settings'];
}
$this->panels['notif'] = $definitions['notif'];
// Keep stable order by priority.
uasort($this->panels, static function (array $a, array $b): int {
return ((int) ($a['priority'] ?? 100)) <=> ((int) ($b['priority'] ?? 100));
});
/**
* 允许插件/子主题注册额外面板
*