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,30 +46,20 @@ 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 echo \AKSRT\User\Level::get_badge_html((int) $user_id); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} }
?> ?>
</h1> <?php
<?php if ($target_user->description) : ?> foreach ($profile_signals as $signal) {
<p class="uc-header__desc"><?php echo esc_html($target_user->description); ?></p> if ((string) ($signal['type'] ?? '') !== 'verify') {
<?php endif; ?> continue;
<?php if (!empty($profile_signals)) : ?> }
<div class="aksrt-identity-chips"> $icon_url = esc_url((string) ($signal['icon_url'] ?? ''));
<?php foreach ($profile_signals as $signal) : ?> if ($icon_url !== '') {
<?php 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" />';
// 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'])); ?>"> </h1>
<?php $icon_url = esc_url((string) ($signal['icon_url'] ?? '')); ?> <?php if ($target_user->description) : ?>
<?php if ($icon_url !== '') : ?> <p class="uc-header__desc"><?php echo esc_html($target_user->description); ?></p>
<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; ?> <?php endif; ?>
<div class="uc-header__meta desc user-identity flex ac hh"> <div class="uc-header__meta desc user-identity flex ac hh">
<span class="uc-header__meta-item" title="<?php esc_attr_e('用户名', 'aksrt'); ?>"> <span class="uc-header__meta-item" title="<?php esc_attr_e('用户名', 'aksrt'); ?>">
+18 -25
View File
@@ -92,18 +92,20 @@ $pm_url = ($pm_enabled && $messages_url !== '')
<div class="aksrt-author-hero__info"> <div class="aksrt-author-hero__info">
<?php if ($show_name) : ?> <?php if ($show_name) : ?>
<h1 class="aksrt-author-hero__name"> <h1 class="aksrt-author-hero__name">
<?php echo esc_html($user->display_name); ?> <?php echo esc_html($user->display_name); ?>
<?php <?php
$vip_badge = function_exists('aksrt_render_vip_badge') ? aksrt_render_vip_badge($user_id) : ''; $vip_badge = function_exists('aksrt_render_vip_badge') ? aksrt_render_vip_badge($user_id) : '';
if ($vip_badge) { if ($vip_badge) {
echo $vip_badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $vip_badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
} }
// Level icon inline to the right of the name (zibll parity). if (function_exists('aksrt_render_user_identity_chips')) {
if (class_exists('\AKSRT\User\Level') && method_exists('\AKSRT\User\Level', 'get_badge_html')) { echo aksrt_render_user_identity_chips($user_id, 'author', [
echo \AKSRT\User\Level::get_badge_html($user_id); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 'include_vip' => false,
} 'skip_level' => false,
?> ]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
</h1> }
?>
</h1>
<?php endif; ?> <?php endif; ?>
<?php <?php
@@ -122,21 +124,12 @@ $pm_url = ($pm_enabled && $messages_url !== '')
? aksrt_get_user_city_badge_html($user_id, 'user_home', 'badg') ? aksrt_get_user_city_badge_html($user_id, 'user_home', 'badg')
: ''; : '';
?> ?>
<?php if ($city_badge !== '' || !empty($signals)) : ?> <?php if ($city_badge !== '') : ?>
<div class="aksrt-author-hero__identity user-identity flex ac hh"> <div class="aksrt-author-hero__identity user-identity flex ac hh">
<?php if ($city_badge !== '') : ?>
<?php echo $city_badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> <?php echo $city_badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>
<?php endif; ?> <?php endif; ?>
<?php if (function_exists('aksrt_render_user_identity_chips')) : ?> <?php if ($show_desc && $user->description) : ?>
<?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> <p class="aksrt-author-hero__desc"><?php echo esc_html($user->description); ?></p>
<?php endif; ?> <?php endif; ?>