//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的编辑器TinyMCE是一个十分弱小的工具,关于网页设计师来说,应用WordPress的编辑器TinyMCE是没什...
共性化登陆界面的办法有两种,第一种是交换登陆背景,这个算是小型共性化吧: 在/wp-admin/images找到login...
首先简略说一说仿登陆的详细操作,用户第一次登陆时会呈现用于填写评论者材料的框,当用户评论实现后,将会...
本文实例讲述了WordPress在SAE平台完成的动态化插件及用法。分享给大家供大家参考,详细如下: WordPress是...
WordPress应用MySQL数据库。作为一个开发者,咱们有必要把握WordPress数据库的根本结构,并在本人的插件或主...
处理办法这是由于空间中的’C:\WINDOWS\TEMP’目录没有设置IIS拜访权限,需求空间商为你设置目录...