评论区硬切换实现小修复
This commit is contained in:
1 parent
0e1b0ce86e
commit
65fbf97099
8 files changed
+29
-26
No files matched your search
@@ -477,7 +477,7 @@ if (!function_exists('aksrt_comments_render_form')) :
|
||||
<div class="comt-avatar mb10">
|
||||
<?php echo get_avatar($current_user->ID, 60, '', '', ['class' => 'avatar']); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</div>
|
||||
<p class="text-ellipsis muted-2-color"><?php echo function_exists('aksrt_render_user_identity_chips') ? aksrt_render_user_identity_chips($current_user->ID, 'comment') : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- chips 内部已转义。 ?><?php echo esc_html($current_user->display_name); ?></p>
|
||||
<p class="text-ellipsis muted-2-color"><?php echo function_exists('aksrt_render_vip_badge') ? aksrt_render_vip_badge($current_user->ID) : ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- vip 徽章内部已转义。 ?><?php echo esc_html($current_user->display_name); ?></p>
|
||||
<?php else : ?>
|
||||
<div class="comt-avatar mb10">
|
||||
<?php echo get_avatar(0, 60, '', '', ['class' => 'avatar']); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
|
||||
@@ -123,14 +123,15 @@ if (!function_exists('aksrt_get_comment_city_badge_html')) :
|
||||
if (!aksrt_comment_city_enabled()) {
|
||||
return '';
|
||||
}
|
||||
if (function_exists('aksrt_get_geo_badge_html')) {
|
||||
return aksrt_get_geo_badge_html(
|
||||
aksrt_get_comment_addr($comment),
|
||||
aksrt_comment_city_type(),
|
||||
'badg badg-sm comment-city-badge'
|
||||
);
|
||||
// legacy 契约:无属地数据时不渲染徽章(不使用查询失败兜底文案)。
|
||||
$addr = aksrt_get_comment_addr($comment);
|
||||
$label = function_exists('aksrt_format_geo_label')
|
||||
? aksrt_format_geo_label(is_array($addr) ? $addr : [], aksrt_comment_city_type())
|
||||
: '';
|
||||
if ($label === '') {
|
||||
return '';
|
||||
}
|
||||
return '';
|
||||
return '<span class="badg badg-sm comment-city-badge aksrt-ip-geo-badge" title="' . esc_attr__('IP 属地', 'aksrt') . '">' . esc_html($label) . '</span>';
|
||||
}
|
||||
endif;
|
||||
|
||||
|
||||
Reference in new issue
Block a user