尝试将代码添加到注释模板中。php文件位于wp includes中,位于
function get_comment_author_link( $comment_ID = 0 ) {
/** @todo Only call these functions when they are needed. Include in if... else blocks */
$url = get_comment_author_url( $comment_ID );
$author = get_comment_author( $comment_ID );
if ( empty( $url ) || \'http://\' == $url )
$return = $author;
else
$return = "<a href=\'$url\' rel=\'external nofollow\' class=\'url\'>$author</a>";
return apply_filters(\'get_comment_author_link\', $return);
}
最终结果如下所示:
function get_comment_author_link( $comment_ID = 0 ) {
/** @todo Only call these functions when they are needed. Include in if... else blocks */
$url = get_comment_author_url( $comment_ID );
$author = get_comment_author( $comment_ID );
if ( empty( $url ) || \'http://\' == $url )
$return = $author;
else
$return = "<a href=\'$url\' rel=\'external nofollow\' class=\'url\'>$author</a>";
return apply_filters(\'get_comment_author_link\', $return);
}
add_filter(\'pre_comment_author_url\', \'filter_comment_url\');
function filter_comment_url($url){
if ($url == "Website" || $url == "http://Website"){
$url = \'\';
}
return $url;
}