//comments link redirect
add_filter('get_comment_author_link', 'add_redirect_comment_link', 5);
add_filter('comment_text', 'add_redirect_comment_link', 99);
function add_redirect_comment_link($text = ''){
$text=str_replace('href="', 'href="'.get_option('home').'/?r=', $text);
$text=str_replace("href='", "href='".get_option('home')."/?r=", $text);
return $text;
}
add_action('init', 'redirect_comment_link');
function redirect_comment_link(){
$redirect = $_GET['r'];
if($redirect){
if(strpos($_SERVER['HTTP_REFERER'],get_option('home')) !== false){
header("Location: $redirect");
exit;
}
else {
header("Location: https://www.jb51.net/");
exit;
}
}
}
//comments link redirect
add_filter('get_comment_author_link', 'add_redirect_comment_author_link', 5);
add_filter('comment_text', 'add_redirect_comment_text', 99);
function add_redirect_comment_author_link($text = ''){
$text=str_replace("href=",'href="javascript:window.location=',ereg_replace('href='[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]'',"0"", $text));return $text;
}
function add_redirect_comment_text($text = ''){
$text=str_replace("href=","href='javascript:window.location=",ereg_replace('href="[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]"',"0'", $text));return $text;
}
以上就是安达网络工作室关于《WordPress 评论者超链接实现重定向跳转的方法》的一些看法。更多内容请查看本栏目更多内容!
本文实例讲述了wordpress完成读者墙的办法。分享给大家供大家参考。详细完成办法如下: 1.复制PAGE.php页面...
WordPress改换空间后 需求调整的几个中央? 1.数据库衔接配置文件 wp-config.php 2.查看.htaccess文件,并修...
首先关上网站根目录下的 wp-config.php,而后搜寻 define('WPLANG' 就能够疾速定位到言语设置那里 比方简体...
博客吧转载了零号相册的Wordpress博客自带嵌套回复教程。 自带嵌套性能工作原理: wordpress嵌套回复的工作...
本文实例讲述了WordPress在SAE平台完成的动态化插件及用法。分享给大家供大家参考,详细如下: WordPress是...
WordPress 不只是博客, 很多时分 WordPress 还被用作为 CMS (内容治理零碎). 博主们喜爱为每个文章加上对立...