diff --git a/assets/css/frontend/header-userbox.css b/assets/css/frontend/header-userbox.css index d762f0cf..01e78904 100644 --- a/assets/css/frontend/header-userbox.css +++ b/assets/css/frontend/header-userbox.css @@ -332,13 +332,14 @@ .aksrt-header-payvip__active { display: flex; - flex-direction: column; + flex-direction: row; align-items: center; justify-content: center; - gap: 2px !important; + gap: 8px !important; width: 100%; min-height: 42px; padding: 7px 10px !important; + white-space: nowrap; } .aksrt-header-payvip__level { @@ -353,7 +354,7 @@ } .aksrt-header-payvip__exp { - display: block; + display: inline; margin: 0; padding: 0; border: 0; @@ -364,6 +365,7 @@ font-weight: 400; line-height: 1.3; opacity: .9; + white-space: nowrap; } /* Navigation links are globally capped at 50px. Account actions are taller diff --git a/inc/helpers/aksrt-header-userbox.php b/inc/helpers/aksrt-header-userbox.php index d0651ca0..71a030f9 100644 --- a/inc/helpers/aksrt-header-userbox.php +++ b/inc/helpers/aksrt-header-userbox.php @@ -139,7 +139,10 @@ if (!function_exists('aksrt_header_payvip_bar')) : $exp_label = ''; if (function_exists('aksrt_get_vip_info')) { $info = aksrt_get_vip_info($user_id); - $exp_label = (string) ($info['expires_label'] ?? ''); + $expires = max(0, (int) ($info['expires'] ?? 0)); + $exp_label = $expires > 0 + ? sprintf(__('到期时间:%s', 'aksrt'), wp_date('Y年m月d日', $expires)) + : (string) ($info['expires_label'] ?? ''); } $html = '