智能总结摘要
AI助理
生成中...
文章最后更新时间:
前言:
获取评论用户IP属地依赖wordpress保存的ip地址,然后利用接口获取该用户所在地区!非常简单,看看效果图!
![图片[1]-WordPress获取评论用户的IP属地-轩逸博客](https://www.xyi66.cn/wp-content/uploads/2022/10/1665828967057.png)
效果图:
![图片[2]-WordPress获取评论用户的IP属地-轩逸博客](https://www.xyi66.cn/wp-content/uploads/2022/10/20221002045139297.bmp)
操作教程:
将下方代码添加到functions.php文件里(/zibll/functions.php)
这里需要到zib-comments-list.php修改(在zibll/inc/functions),先搜索$replyText_html跳到第二个,然后粘贴下方的代码覆盖它即可!
$user_ip = $comment->comment_author_IP;$replyText_html = '<span class="reply-link">' . $replyText . '</span><span style="cursor:pointer" data-toggle="tooltip" alt="IP:'.$user_ip.'" data-original-title="IP地址:'.xypro_user_ip($user_ip).'">'.xypro_user_ip($user_ip).'</span>';$user_ip = $comment->comment_author_IP; $replyText_html = '<span class="reply-link">' . $replyText . '</span><span style="cursor:pointer" data-toggle="tooltip" alt="IP:'.$user_ip.'" data-original-title="IP地址:'.xypro_user_ip($user_ip).'">'.xypro_user_ip($user_ip).'</span>';$user_ip = $comment->comment_author_IP; $replyText_html = '<span class="reply-link">' . $replyText . '</span><span style="cursor:pointer" data-toggle="tooltip" alt="IP:'.$user_ip.'" data-original-title="IP地址:'.xypro_user_ip($user_ip).'">'.xypro_user_ip($user_ip).'</span>';
感谢您的来访,获取更多精彩文章请收藏本站。

供学习和研究使用,请在下载后24小时内删除
购买前可以联系作者确认资源信息,防止交易矛盾
Finger rift,twisted in the love.
如果你为着错过夕阳而哭泣,那么你就要错群星了
THE END
- 最新
- 最热
查看全部