ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
``` //评论链接重写 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; } 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: ".bloginfo('url')."/"); exit; } } } add_action('init', 'redirect_comment_link'); add_filter('get_comment_author_link', 'add_redirect_comment_link', 5); add_filter('comment_text', 'add_redirect_comment_link', 99); ```