feat(users): medal auto-grant + aksrt_get_user_name chrome

Add AKSRT_User_Badges::auto_evaluate on login for get_type metrics,
introduce aksrt_get_user_name (auth→wear medal→level→follow order),
wire single author bar/card, and document transfer/withdraw default-closed
semantics on capabilities page. audit errors=0.
This commit is contained in:
2026-07-17 01:12:09 +08:00
parent 1b0eed6ef7
commit b4d04ae346
5 changed files with 299 additions and 16 deletions
+21 -6
View File
@@ -331,7 +331,18 @@ if (!function_exists('aksrt_single_render_author_card')) :
$author_url = get_author_posts_url($author_id);
$author_name = get_the_author();
$bio = trim((string) get_the_author_meta('description'));
$identity_chips = function_exists('aksrt_render_user_identity_chips')
$name_html = function_exists('aksrt_get_user_name')
? aksrt_get_user_name([
'id' => $author_id,
'class' => 'user-name flex jc ac',
'vip' => true,
'medal' => true,
'auth' => true,
'level' => true,
'follow' => false,
])
: '';
$identity_chips = ($name_html === '' && function_exists('aksrt_render_user_identity_chips'))
? aksrt_render_user_identity_chips($author_id, 'card')
: '';
$avatar = function_exists('aksrt_get_avatar_html')
@@ -362,12 +373,16 @@ if (!function_exists('aksrt_single_render_author_card')) :
<div class="user-content">
<div class="user-avatar"><?php echo $avatar; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
<div class="user-info mt20 mb10">
<div class="user-name flex jc ac">
<a class="display-name" href="<?php echo esc_url($author_url); ?>"><?php echo esc_html($author_name); ?></a>
<?php if ($identity_chips !== '') : ?>
<?php echo $identity_chips; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php if ($name_html !== '') : ?>
<?php echo $name_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php else : ?>
<div class="user-name flex jc ac">
<a class="display-name" href="<?php echo esc_url($author_url); ?>"><?php echo esc_html($author_name); ?></a>
<?php if ($identity_chips !== '') : ?>
<?php echo $identity_chips; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<?php if ($bio !== '') : ?>
<div class="user-desc mt10 muted-2-color em09"><?php echo esc_html($bio); ?></div>
<?php endif; ?>