Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// return location from user ip
require 'IP.class.php';
$lar = Ip::find($rip);
$i = count($lar) - 1;
$loc = "地球";
while($i >=0 ){
if(strlen($lar[$i]) > 0 ) {
$loc = $lar[$i];
$i --;
echo $loc;
*Plugin Name: SomeMoreSentence
*Version: 0.1
*Plugin URI:
*Description: append some more sentence after the end of your post
*Author: Yu Jing
*Author URI:
function SomeMoreSentence($outer){
if(!is_singular()){ return $outer; }
global $post;
$tmp = "<blockquote>来自<a id='remote_loc'></a>的你,很高兴你能看到这儿。若本文对你有所用处,或者内容有什么不足之处,敬请毫不犹豫给个回复。谢谢!</blockquote><script type='text/javascript'>
$.get('/api/ip/', function(data,status){
$outer = $outer.$tmp;
return $outer;
add_filter('the_content', 'SomeMoreSentence');
//add_filter('the_content', 'SomeMoreSentence',11);// the bigger the number is ,the latter ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment