feat(ip-geo): full-chain IP 归属地 on comments, user home, center, post

This commit is contained in:
kate522 committed 2026-07-25 14:39:47 +08:00
1 parent 1f2ca3ac8f
commit ac7ff8d4f2
13 files changed
+457 -33

No files matched your search

+9
View File
@@ -94,6 +94,15 @@ $is_self = is_user_logged_in() && get_current_user_id() === $author_id;
<?php if ($show_time) : ?>
<span class="icon-circle" title="<?php echo esc_attr($abs_fmt); ?>" data-toggle="tooltip"><?php echo esc_html($time_text); ?></span>
<?php endif; ?>
<?php
// Article detail IP 归属地 (extension display: post).
$post_city = function_exists('aksrt_get_post_author_city_badge_html')
? aksrt_get_post_author_city_badge_html($author_id, 'badg badg-sm')
: '';
if ($post_city !== '') {
echo $post_city; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
?>
<?php if ($show_bio) : ?>
<?php $bio = trim((string) get_the_author_meta('description')); ?>
<?php if ($bio !== '') : ?>
+22 -11
View File
@@ -112,19 +112,30 @@ $pm_url = ($pm_enabled && $messages_url !== '')
}
?>
<?php if ($show_desc && $user->description) : ?>
<p class="aksrt-author-hero__desc"><?php echo esc_html($user->description); ?></p>
<?php
// IP 归属地 (zibll author_header_identity / user_city_s).
$city_badge = function_exists('aksrt_get_user_city_badge_html')
? aksrt_get_user_city_badge_html($user_id, 'user_home', 'badg')
: '';
?>
<?php if ($city_badge !== '' || !empty($signals)) : ?>
<div class="aksrt-author-hero__identity user-identity flex ac hh">
<?php if ($city_badge !== '') : ?>
<?php echo $city_badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php endif; ?>
<?php if (!empty($signals)) : ?>
<?php foreach ($signals as $signal) : ?>
<span class="aksrt-identity-chip aksrt-identity-chip--<?php echo esc_attr($signal['tone']); ?>">
<i class="fas fa-<?php echo esc_attr($signal['icon']); ?>" aria-hidden="true"></i>
<span><?php echo esc_html($signal['label']); ?></span>
</span>
<?php endforeach; ?>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if (!empty($signals)) : ?>
<div class="aksrt-identity-chips">
<?php foreach ($signals as $signal) : ?>
<span class="aksrt-identity-chip aksrt-identity-chip--<?php echo esc_attr($signal['tone']); ?>">
<i class="fas fa-<?php echo esc_attr($signal['icon']); ?>" aria-hidden="true"></i>
<span><?php echo esc_html($signal['label']); ?></span>
</span>
<?php endforeach; ?>
</div>
<?php if ($show_desc && $user->description) : ?>
<p class="aksrt-author-hero__desc"><?php echo esc_html($user->description); ?></p>
<?php endif; ?>
<?php if (!empty($notice) && is_array($notice)) : ?>