fix: expose affiliate promotion center

This commit is contained in:
kate522 committed 2026-08-16 19:33:42 +08:00
1 parent 99db790a6f
commit f70eca09d1
3 files changed
+26 -3

No files matched your search

@@ -10,11 +10,31 @@ defined('ABSPATH') || exit;
$level_url = isset($dashboard_tabs['level']) $level_url = isset($dashboard_tabs['level'])
? aksrt_get_user_center_tab_url('level') ? aksrt_get_user_center_tab_url('level')
: ''; : '';
$promotion_url = isset($dashboard_tabs['promotion'])
? aksrt_get_user_center_tab_url('promotion')
: '';
$revenue_url = isset($dashboard_tabs['revenue'])
? aksrt_get_user_center_tab_url('revenue')
: '';
$auth_url = isset($dashboard_tabs['auth']) ? aksrt_get_user_center_tab_url('auth') : ''; $auth_url = isset($dashboard_tabs['auth']) ? aksrt_get_user_center_tab_url('auth') : '';
$orders_available = isset($dashboard_tabs['orders']); $orders_available = isset($dashboard_tabs['orders']);
$orders_url = $orders_available ? (string) ($orders_url ?? '') : ''; $orders_url = $orders_available ? (string) ($orders_url ?? '') : '';
$services = array_values(array_filter([ $services = array_values(array_filter([
[
'label' => __('推广中心', 'aksrt'),
'icon' => 'share-alt',
'tone' => 'promotion',
'url' => $promotion_url,
'tab' => 'promotion',
],
[
'label' => __('收益中心', 'aksrt'),
'icon' => 'chart-line',
'tone' => 'revenue',
'url' => $revenue_url,
'tab' => 'revenue',
],
[ [
'label' => __('我的等级', 'aksrt'), 'label' => __('我的等级', 'aksrt'),
'icon' => 'chart-line', 'icon' => 'chart-line',
+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 { function aksrt_get_user_center_url(string $tab = ''): string {
$tab = sanitize_key($tab ?: 'vip'); $tab = sanitize_key($tab ?: 'vip');
$aliases = ['assets' => 'credits', 'signin' => 'credits', 'invite' => 'revenue', 'promotion' => 'revenue']; $aliases = ['assets' => 'credits', 'signin' => 'credits', 'invite' => 'promotion', 'promotion' => 'promotion'];
$tab = $aliases[$tab] ?? $tab; $tab = $aliases[$tab] ?? $tab;
$path_tab = $tab === 'credits' ? 'balance' : $tab; $path_tab = $tab === 'credits' ? 'balance' : $tab;
return get_option('permalink_structure') return get_option('permalink_structure')
+5 -2
View File
@@ -218,8 +218,11 @@ $hmb_js = get_template_directory() . '/assets/js/header-newadd.js';
$balance_on = is_user_logged_in() $balance_on = is_user_logged_in()
&& class_exists('\AKSRT\Credits\Balance') && class_exists('\AKSRT\Credits\Balance')
&& \AKSRT\Credits\Balance::enabled(); && \AKSRT\Credits\Balance::enabled();
$affiliate_on = is_user_logged_in()
&& class_exists('\\AKSRT\\Settings\\Settings')
&& !empty(\AKSRT\Settings\Settings::get_affiliate_settings()['enabled']);
$vip_coordinator = get_template_directory() . '/assets/js/vip-purchase-coordinator.js'; $vip_coordinator = get_template_directory() . '/assets/js/vip-purchase-coordinator.js';
if (($vip_on || $credits_on) && file_exists($vip_coordinator)) { if (($vip_on || $credits_on || $affiliate_on) && file_exists($vip_coordinator)) {
wp_enqueue_script( wp_enqueue_script(
'aksrt-vip-coordinator', 'aksrt-vip-coordinator',
$base_uri . '/assets/js/vip-purchase-coordinator.js', $base_uri . '/assets/js/vip-purchase-coordinator.js',
@@ -821,7 +824,7 @@ $hmb_js = get_template_directory() . '/assets/js/header-newadd.js';
} }
// 积分相关:已登录 + 启用积分功能时全站加载 // 积分相关:已登录 + 启用积分功能时全站加载
if ($credits_on || $balance_on) { if ($credits_on || $balance_on || $affiliate_on) {
$enqueue_module('credits'); $enqueue_module('credits');
// profile 页:加载 credits.js(签到 + 邀请 + 提现交互) // profile 页:加载 credits.js(签到 + 邀请 + 提现交互)