fix(user): remove medals beside profile names
This commit is contained in:
1 parent
ad3d431d18
commit
9781369b6b
3 files changed
+6
-2
No files matched your search
@@ -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 $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_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 {
|
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') {
|
if (!empty($args['skip_level']) && $type === 'level') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!empty($args['skip_badges']) && $type === 'badge') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$tone = sanitize_html_class((string) ($signal['tone'] ?? 'info'));
|
$tone = sanitize_html_class((string) ($signal['tone'] ?? 'info'));
|
||||||
$icon = sanitize_html_class((string) ($signal['icon'] ?? 'check'));
|
$icon = sanitize_html_class((string) ($signal['icon'] ?? 'check'));
|
||||||
$icon_url = esc_url((string) ($signal['icon_url'] ?? ''));
|
$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">
|
<h1 class="uc-header__name">
|
||||||
<?php echo esc_html($target_user->display_name); ?>
|
<?php echo esc_html($target_user->display_name); ?>
|
||||||
<?php if (function_exists('aksrt_render_user_identity_chips')) : ?>
|
<?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; ?>
|
<?php endif; ?>
|
||||||
</h1>
|
</h1>
|
||||||
<div class="uc-header__meta desc user-identity flex ac hh">
|
<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) : ?>
|
<?php if ($show_name) : ?>
|
||||||
<h1 class="aksrt-author-hero__name">
|
<h1 class="aksrt-author-hero__name">
|
||||||
<?php if (function_exists('aksrt_get_user_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 else : ?>
|
||||||
<?php echo esc_html($user->display_name); ?>
|
<?php echo esc_html($user->display_name); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|||||||
Reference in new issue
Block a user