fix(user): align badge entry with medal settings

This commit is contained in:
2026-08-11 19:32:52 +08:00
parent e1dc9ab277
commit 51b52affae
7 changed files with 143 additions and 25 deletions
+7 -11
View File
@@ -100,25 +100,21 @@ $pm_url = ($pm_enabled && $messages_url !== '')
</h1>
<?php endif; ?>
<?php if (class_exists('\AKSRT\User\Badges') && \AKSRT\User\Badges::enabled() && \AKSRT\User\Badges::public_display()) : ?>
<div class="aksrt-author-hero__badges">
<button type="button" class="but but-sm jb-blue mt6" data-aksrt-badges-open data-aksrt-badges-user-id="<?php echo (int) $user_id; ?>" data-aksrt-badges-can-wear="<?php echo $is_own ? '1' : '0'; ?>">
<i class="fas fa-award" aria-hidden="true"></i> <?php esc_html_e('徽章明细', 'aksrt'); ?>
</button>
</div>
<?php endif; ?>
<?php
// IP 归属地 (zibll author_header_identity / user_city_s).
// Zibll parity: the badge overview leads the identity row.
$city_badge = function_exists('aksrt_get_user_city_badge_html')
? aksrt_get_user_city_badge_html($user_id, 'user_home', 'badg')
: '';
$medal_entry = function_exists('aksrt_render_user_medal_entry')
? aksrt_render_user_medal_entry($user_id, 'user-home', $is_own)
: '';
?>
<?php if ($city_badge !== '') : ?>
<?php if ($medal_entry !== '' || $city_badge !== '') : ?>
<div class="aksrt-author-hero__identity user-identity flex ac hh">
<?php echo $medal_entry; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php echo $city_badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($show_desc && $user->description) : ?>
<p class="aksrt-author-hero__desc"><?php echo esc_html($user->description); ?></p>
<?php endif; ?>