fix: 认证图标与用户名同行

This commit is contained in:
2026-07-31 11:25:11 +08:00
parent 06a03fd9cf
commit d9a3685001
2 changed files with 30 additions and 47 deletions
@@ -46,31 +46,21 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_
echo \AKSRT\User\Level::get_badge_html((int) $user_id); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
?>
<?php
foreach ($profile_signals as $signal) {
if ((string) ($signal['type'] ?? '') !== 'verify') {
continue;
}
$icon_url = esc_url((string) ($signal['icon_url'] ?? ''));
if ($icon_url !== '') {
echo '<img class="aksrt-identity-certification-icon img-icon ml3" src="' . $icon_url . '" alt="" title="' . esc_attr((string) ($signal['title'] ?? $signal['label'] ?? '')) . '" loading="lazy" decoding="async" />';
}
}
?>
</h1>
<?php if ($target_user->description) : ?>
<p class="uc-header__desc"><?php echo esc_html($target_user->description); ?></p>
<?php endif; ?>
<?php if (!empty($profile_signals)) : ?>
<div class="aksrt-identity-chips">
<?php foreach ($profile_signals as $signal) : ?>
<?php
// Level is rendered inline next to the name above; skip it here.
if ((string) ($signal['type'] ?? '') === 'level') {
continue;
}
?>
<span class="aksrt-identity-chip aksrt-identity-chip--<?php echo esc_attr($signal['tone']); ?>" title="<?php echo esc_attr((string) ($signal['title'] ?? $signal['label'])); ?>">
<?php $icon_url = esc_url((string) ($signal['icon_url'] ?? '')); ?>
<?php if ($icon_url !== '') : ?>
<img class="aksrt-identity-certification-icon img-icon" src="<?php echo $icon_url; ?>" alt="<?php echo esc_attr($signal['label']); ?>" loading="lazy" decoding="async">
<?php else : ?>
<i class="fas fa-<?php echo esc_attr($signal['icon']); ?>" aria-hidden="true"></i>
<?php endif; ?>
<span><?php echo esc_html($signal['label']); ?></span>
</span>
<?php endforeach; ?>
</div>
<?php endif; ?>
<div class="uc-header__meta desc user-identity flex ac hh">
<span class="uc-header__meta-item" title="<?php esc_attr_e('用户名', 'aksrt'); ?>">
<i class="fas fa-user" aria-hidden="true"></i> <?php echo esc_html($target_user->user_login); ?>
+6 -13
View File
@@ -98,9 +98,11 @@ $pm_url = ($pm_enabled && $messages_url !== '')
if ($vip_badge) {
echo $vip_badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
// Level icon inline to the right of the name (zibll parity).
if (class_exists('\AKSRT\User\Level') && method_exists('\AKSRT\User\Level', 'get_badge_html')) {
echo \AKSRT\User\Level::get_badge_html($user_id); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
if (function_exists('aksrt_render_user_identity_chips')) {
echo aksrt_render_user_identity_chips($user_id, 'author', [
'include_vip' => false,
'skip_level' => false,
]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
?>
</h1>
@@ -122,20 +124,11 @@ $pm_url = ($pm_enabled && $messages_url !== '')
? aksrt_get_user_city_badge_html($user_id, 'user_home', 'badg')
: '';
?>
<?php if ($city_badge !== '' || !empty($signals)) : ?>
<div class="aksrt-author-hero__identity user-identity flex ac hh">
<?php if ($city_badge !== '') : ?>
<div class="aksrt-author-hero__identity user-identity flex ac hh">
<?php echo $city_badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php endif; ?>
<?php if (function_exists('aksrt_render_user_identity_chips')) : ?>
<?php
// Level already rendered inline next to the name above; skip it here.
echo aksrt_render_user_identity_chips($user_id, 'author', ['include_vip' => false, 'skip_level' => true]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
?>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($show_desc && $user->description) : ?>
<p class="aksrt-author-hero__desc"><?php echo esc_html($user->description); ?></p>
<?php endif; ?>