//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. 装置 Docker 在咱们真正开端之前,咱们需求确保在咱们的 Linux 机器上曾经装置了 Docker。咱们应用的主机...
我要对文章进行排序,依照投票数的多少排,曾经投票的都会记载投票数,而没有投票的文章没有记载,默许投票...
1、右键复制时显示提醒语 把上面代码放到footer.php里即可 复制代码代码如下:<html> <head><title>防...
WordPress菜单CSS类选项设置办法: 1、点开WordPress菜单设置页面右上角“显示选项”,勾选外面的...
本文实例讲述了WORDPRESS文章中微信打赏性能的2种完成办法。分享给大家供大家参考,详细如下: 打赏性能性能...