评论区硬切换实现小修复

This commit is contained in:
kate522 committed 2026-08-30 19:04:41 +08:00
1 parent 0e1b0ce86e
commit 65fbf97099
8 files changed
+29 -26

No files matched your search

+8 -7
View File
@@ -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;