fix: improve promotion tabs and referral layout
This commit is contained in:
1 parent
5b9f54f5ac
commit
853114a9f9
18 files changed
+127
-602
No files matched your search
@@ -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(); }
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in new issue
Block a user