Definition:
function wp_rel_nofollow_callback( $matches ) {}
Callback to used to add rel=nofollow string to HTML A element.
Will remove already existing rel="nofollow" and rel=’nofollow’ from the string to prevent from invalidating (X)HTML.
Parameters
- array $matches: Single Match
Return values
returns:HTML A Element with rel nofollow.
Source code
function wp_rel_nofollow_callback( $matches ) {
$text = $matches[1];
$text = str_replace(array(' rel="nofollow"', " rel='nofollow'"), '', $text);
return "<a $text rel=\"nofollow\">";
}
4031

February 12, 2011 


No comments yet... Be the first to leave a reply!