fix(user): remove medals beside profile names
This commit is contained in:
@@ -36,6 +36,7 @@ if (!function_exists('aksrt_render_user_identity_chips')) {
|
||||
*
|
||||
* @type bool $include_vip Whether to prepend VIP badge. Default true.
|
||||
* @type bool $skip_level Whether to omit the level chip (rendered inline elsewhere). Default false.
|
||||
* @type bool $skip_badges Whether to omit badge signals from this row. Default false.
|
||||
* }
|
||||
*/
|
||||
function aksrt_render_user_identity_chips(int $user_id, string $context = 'author', array $args = []): string {
|
||||
@@ -75,6 +76,9 @@ if (!function_exists('aksrt_render_user_identity_chips')) {
|
||||
if (!empty($args['skip_level']) && $type === 'level') {
|
||||
continue;
|
||||
}
|
||||
if (!empty($args['skip_badges']) && $type === 'badge') {
|
||||
continue;
|
||||
}
|
||||
$tone = sanitize_html_class((string) ($signal['tone'] ?? 'info'));
|
||||
$icon = sanitize_html_class((string) ($signal['icon'] ?? 'check'));
|
||||
$icon_url = esc_url((string) ($signal['icon_url'] ?? ''));
|
||||
|
||||
@@ -37,7 +37,7 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_
|
||||
<h1 class="uc-header__name">
|
||||
<?php echo esc_html($target_user->display_name); ?>
|
||||
<?php if (function_exists('aksrt_render_user_identity_chips')) : ?>
|
||||
<?php echo aksrt_render_user_identity_chips((int) $user_id, 'author', ['include_vip' => true]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php echo aksrt_render_user_identity_chips((int) $user_id, 'author', ['include_vip' => true, 'skip_badges' => true]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php endif; ?>
|
||||
</h1>
|
||||
<div class="uc-header__meta desc user-identity flex ac hh">
|
||||
|
||||
@@ -93,7 +93,7 @@ $pm_url = ($pm_enabled && $messages_url !== '')
|
||||
<?php if ($show_name) : ?>
|
||||
<h1 class="aksrt-author-hero__name">
|
||||
<?php if (function_exists('aksrt_get_user_name')) : ?>
|
||||
<?php echo aksrt_get_user_name(['id' => $user_id, 'class' => 'aksrt-author-hero__name-inner', 'vip' => true, 'medal' => true, 'auth' => true, 'level' => true, 'follow' => false]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php echo aksrt_get_user_name(['id' => $user_id, 'class' => 'aksrt-author-hero__name-inner', 'vip' => true, 'medal' => false, 'auth' => true, 'level' => true, 'follow' => false]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php else : ?>
|
||||
<?php echo esc_html($user->display_name); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
Reference in New Issue
Block a user