WordPress评论链接添加go跳转

WordPress 云上的幻象 2个月前 (02-01) 98次浏览 3个评论 扫描二维码

如题,以下代码即可帮你完成在评论链接添加go跳转。找到你主题目录下的”functions.php”文件,添加以下代码上传覆盖即可。

/* WordPress评论者链接添加go跳转
/*-----------------------------------------------------------------------------------*/
 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').'/go.php?url=', $text);
			$text=str_replace("href='", "href='".get_option('home')."/go.php?url=", $text);
 return $text;
 }
喜欢 (0)
[[email protected]]
分享 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(3)个小伙伴在吐槽
  1. Luxury Alcohol Rehab http://aaa-rehab.com Drug Rehab Centers Alcohol Treatment Facilities Near Me http://zkmbk.in.ua/user/rehabcenter/
    Alcohol Rehab Near Me2020-03-31 03:01 (7小时前)回复 Windows 10 | Chrome 67.0.3396.87
  2. Free Drug Counseling Near Me http://aaa-rehab.com Drug Rehab Centers Near Me Substance Use Prevention https://puk.chitanka.info/user/iviva/
    Free Rehabilitation Centers Near Me2020-03-30 12:18 (22小时前)回复 Windows 10 | Chrome 67.0.3396.79
  3. Drug Abuse Treatment Centers Near Me http://aaa-rehab.com Drug Rehab Centers Near Me http://aaa-rehab.com Methadone Clinic Near Me http://aaa-rehab.com
    Alcohol Abuse Disorder Dsm 52020-03-26 23:09 (4天前)回复 Windows 7 | Chrome 66.0.3359.181