26 lines
1.0 KiB
PHP
26 lines
1.0 KiB
PHP
<?php
|
|
/**
|
|
* Public user home — credits tab panel body (own profile only).
|
|
*
|
|
* Rendered inside the #panel-credits wrapper on the public user home. Static
|
|
* balance card; no pagination, no REST swapping needed.
|
|
*
|
|
* @package AKSRT
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
$args = is_array($args ?? null) ? $args : [];
|
|
extract($args, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_extract
|
|
|
|
if (empty($credits_enabled) || empty($is_own_profile)) {
|
|
return;
|
|
}
|
|
?>
|
|
<div class="user-home-balance-card">
|
|
<p class="user-home-balance-card__label"><?php echo esc_html(sprintf(__('当前%s余额', 'aksrt'), $currency_name)); ?></p>
|
|
<div class="user-home-balance-card__value"><?php echo esc_html(aksrt_format_points($credit_balance)); ?></div>
|
|
<p class="user-home-balance-card__hint"><?php esc_html_e('完整账单和赚取/消费记录请在用户中心查看。', 'aksrt'); ?></p>
|
|
<a href="<?php echo esc_url(aksrt_get_user_center_url('credits')); ?>" class="btn-outline btn-sm"><?php esc_html_e('进入用户中心', 'aksrt'); ?></a>
|
|
</div>
|