Advertisements

wp_rel_nofollow_callback

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

Advertisements

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: