SO网友:Keith S.
您还可以向函数中添加类似的内容。php为您的每篇文章或页面添加一个短链接(由tinyurl提供支持):
function shortLink($content) {
$url = \'http://\'.$_SERVER[\'HTTP_HOST\'].$_SERVER[\'REQUEST_URI\'];
$short_url = file_get_contents(\'http://tinyurl.com/api-create.php?url=\'.urlencode($url));
$content .= \'<div class="short-link">Here\'s a short link <a href=".$short_url.\'">Short Link</a></div>\';
return $content;
}
添加\\u filter(\'the\\u content\',\'shortLink\');