Skip to content

Instantly share code, notes, and snippets.

@ninetwentyfour
Created August 28, 2011 19:20
Show Gist options
  • Select an option

  • Save ninetwentyfour/1177082 to your computer and use it in GitHub Desktop.

Select an option

Save ninetwentyfour/1177082 to your computer and use it in GitHub Desktop.
Remove WordPress’ NoFollow Without A Plugin - blogpost
<?php
function comment_author_link_mine( $comment_ID = 0 ) {
echo get_comment_author_link_mine( $comment_ID );
}
function get_comment_author_link_mine( $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' class='comment_url'>$author</a>";
return apply_filters('get_comment_author_link', $return);
}
?>
<?php comment_author_link(); ?>
<?php comment_author_link_mine(); ?>
$return = "<a href='$url' rel='external nofollow' class='url'>$author</a>";
$return = "<a href='$url' class='comment_url'>$author</a>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment