feat: merge promotion and earnings center

This commit is contained in:
kate522 committed 2026-08-16 19:54:12 +08:00
1 parent f70eca09d1
commit 6dbb556d60
11 files changed
+65 -87

No files matched your search

+4 -1
View File
@@ -53,9 +53,12 @@ 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', 'revenue', 'settings'];
: ['profile', 'level', 'creator', 'posts', 'follow', 'comments', 'favorites', 'credits', 'vip', 'orders', 'auth', 'promotion', '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'];
$aliases = ['assets' => 'credits', 'signin' => 'credits', 'invite' => 'promotion', 'promotion' => 'promotion', 'revenue' => 'promotion'];
$tab = $aliases[$tab] ?? $tab;
$path_tab = $tab === 'credits' ? 'balance' : $tab;
return get_option('permalink_structure')