fix(user-center): close creator income review gaps
This commit is contained in:
+8
-11
@@ -116,7 +116,7 @@ class Center {
|
||||
$settings = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_user_center_settings()
|
||||
: [
|
||||
'tabs' => ['profile', 'posts', 'comments', 'favorites'],
|
||||
'tabs' => ['profile', 'comments', 'favorites'],
|
||||
'avatar_upload' => true,
|
||||
'cover_upload' => true,
|
||||
'social_links' => true,
|
||||
@@ -135,12 +135,6 @@ class Center {
|
||||
'priority' => 15,
|
||||
'type' => 'panel',
|
||||
],
|
||||
'posts' => [
|
||||
'label' => __('我的文章', 'aksrt'),
|
||||
'icon' => 'file-alt',
|
||||
'priority' => 20,
|
||||
'type' => 'panel',
|
||||
],
|
||||
'creator' => [
|
||||
'label' => __('创作中心', 'aksrt'),
|
||||
'icon' => 'feather-alt',
|
||||
@@ -206,9 +200,12 @@ class Center {
|
||||
];
|
||||
|
||||
$this->panels = [];
|
||||
$configured = array_values(array_filter(array_map('sanitize_key', (array) ($settings['tabs'] ?? []))));
|
||||
$configured = array_values(array_filter(
|
||||
array_map('sanitize_key', (array) ($settings['tabs'] ?? [])),
|
||||
static fn(string $key): bool => $key !== 'posts'
|
||||
));
|
||||
if ($configured === []) {
|
||||
$configured = ['profile', 'posts', 'comments', 'favorites'];
|
||||
$configured = ['profile', 'comments', 'favorites'];
|
||||
}
|
||||
|
||||
$level_on = class_exists('\AKSRT\User\Level')
|
||||
@@ -246,7 +243,7 @@ class Center {
|
||||
|
||||
if ($vip_on && !in_array('vip', $order, true)) {
|
||||
$insert_at = count($order);
|
||||
foreach (['credits', 'favorites', 'posts'] as $anchor) {
|
||||
foreach (['credits', 'favorites'] as $anchor) {
|
||||
$idx = array_search($anchor, $order, true);
|
||||
if ($idx !== false) {
|
||||
$insert_at = (int) $idx + 1;
|
||||
@@ -278,7 +275,7 @@ class Center {
|
||||
|
||||
if ($revenue_tab_on && !in_array('revenue', $order, true)) {
|
||||
$insert_at = count($order);
|
||||
foreach (['credits', 'favorites', 'posts'] as $anchor) {
|
||||
foreach (['credits', 'favorites'] as $anchor) {
|
||||
$idx = array_search($anchor, $order, true);
|
||||
if ($idx !== false) {
|
||||
$insert_at = (int) $idx + 1;
|
||||
|
||||
Reference in New Issue
Block a user