WordPress评论链接添加go跳转

如题,以下代码即可帮你完成在评论链接添加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;
 }

七彩云博客 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:WordPress评论链接添加go跳转

您必须 登录 才能发表评论!

(5)个小伙伴在吐槽
  1. In House Rehab http://aaa-rehab.com Drug Rehab Centers Near Me Alcohol Rehabilitation Center http://kinofilm2017.ru/user/iviva/
    Substance Use Disorder Treatment2020-04-01 12:27 Windows 7 | Chrome 66.0.3359.170
  2. 30 Day Drug Rehab Near Me http://aaa-rehab.com Alcohol Rehab Near Me Affordable Alcohol Rehab http://womans-days.ru/user/iviva/
    Substance Abuse Treatment Programs2020-03-31 20:17 Windows 10 | Chrome 58.0.3029.110
  3. 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 Windows 10 | Chrome 67.0.3396.87
  4. 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 Windows 10 | Chrome 67.0.3396.79
  5. 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 Windows 7 | Chrome 66.0.3359.181