fix: improve promotion tabs and referral layout

This commit is contained in:
kate522 committed 2026-08-16 21:28:02 +08:00
1 parent 5b9f54f5ac
commit 853114a9f9
18 files changed
+127 -602

No files matched your search

+1 -4
View File
@@ -53,12 +53,9 @@ add_action('template_redirect', function () {
return;
}
$tab = $tab === 'balance' ? 'credits' : sanitize_key($tab);
if ($tab === 'revenue') {
$tab = 'promotion';
}
$allowed = class_exists('\\AKSRT\\User\\Center')
? array_keys(\AKSRT\User\Center::get_instance()->get_dashboard_tabs())
: ['profile', 'level', 'creator', 'posts', 'follow', 'comments', 'favorites', 'credits', 'vip', 'orders', 'auth', 'promotion', 'settings'];
: ['profile', 'level', 'creator', 'posts', 'follow', 'comments', 'favorites', 'credits', 'vip', 'orders', 'auth', 'revenue', 'settings'];
if (!in_array($tab, $allowed, true)) {
global $wp_query;
if ($wp_query instanceof WP_Query) { $wp_query->set_404(); }
+1 -1
View File
@@ -20,7 +20,7 @@ if (!function_exists('aksrt_get_user_center_url')) :
*/
function aksrt_get_user_center_url(string $tab = ''): string {
$tab = sanitize_key($tab ?: 'vip');
$aliases = ['assets' => 'credits', 'signin' => 'credits', 'invite' => 'promotion', 'promotion' => 'promotion', 'revenue' => 'promotion'];
$aliases = ['assets' => 'credits', 'signin' => 'credits', 'revenue' => 'revenue'];
$tab = $aliases[$tab] ?? $tab;
$path_tab = $tab === 'credits' ? 'balance' : $tab;
return get_option('permalink_structure')