Preventing repeated ‘rel=”nofollow”‘
-
Adding the if-statement below before line 594 of functions-formatting.php 2.0.4, will prevent the filter from adding multiple ‘rel=”nofollow”‘ to links in comments when a comment is edited, which is the current behaviour.
if (preg_match('/rel=\"nofollow\"/i', $text) == 0)
The function wp_rel_nofollow( $text ), will be as follows:
function wp_rel_nofollow( $text ) {
if (preg_match('/rel=\"nofollow\"/i', $text) == 0)
$text = preg_replace('|<a (.+?)>|i', '<a $1 rel="nofollow">', $text);
return $text;
}
Repeated rel=”nofollow” will not break your blog in any way. All it does is cause an XHTML validator to throw a warning.Regards,
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Preventing repeated ‘rel=”nofollow”‘’ is closed to new replies.