[wp-hackers] more nofollow

Robert Deaton false.hopes at gmail.com
Mon Jan 24 16:34:04 GMT 2005


Has anyone on this list yet tried to make a plugin to remove nofollow?
I just sat down for the last hour or so looking over many little bits
of core code and have found it to be impossible due to the filter on
get_comment_author_link() and its general method, without using regex
to manually cut out the nofollow mess. I did however get it to remove
nofollow on links in the comment text, so it can at least be partly
undone.

Here's what I did for the comment text:
//This is a duplicate of the original function make_clickable before
nofollow support was added.
function no_nf_make_clickable($ret)
{
	$ret = ' ' . $ret . ' ';
	$ret = preg_replace("#([\s>])(https?)://([^\s<>{}()]+[^\s.,<>{}()])#i",
"$1<a href='$2://$3'>$2://$3</a>", $ret);
	$ret = preg_replace("#(\s)www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^
<>{}()\n\r]*[^., <>{}()\n\r]?)?)#i", "$1<a
href='http://www.$2.$3$4'>www.$2.$3$4</a>", $ret);
	$ret = preg_replace("#(\s)([a-z0-9\-_.]+)@([^,< \n\r]+)#i", "$1<a
href=\"mailto:$2@$3\">$2@$3</a>", $ret);
	$ret = trim($ret);
	return $ret;
}

	remove_filter('comment_text', 'make_clickable');
	add_filter('comment_text', 'no_nf_make_clickable');


On Mon, 24 Jan 2005 07:47:42 -0800, Matthew Mullenweg <m at mullenweg.com> wrote:
> Scott Merrill wrote:
> >    is it logically consistent with the idea of
> >    the plugin system (ie: a mechanism to _add_
> >    functionality to WordPress) that users be
> >    required find and enable a plugin to _disable_
> >    a feature of WordPress (ie: nofollow)?
> 
> Completely. Several times decisions have been made that benefit the
> public and the vast majority of our users for things to be included by
> default, and optionally disabled through plugins. (Think automatic line
> breaks.) The noisy minority on this list is essentially an echo chamber
> of people unusually opposed to the issue. That isn't a bad thing, and I
> respect the opinion of people who feel this way even though I disagree
> with it. (As long as you don't make personal jabs at me. *cough*)
> 
> However the fortunate thing is that the cross-section of people who know
> enough to make an intelligent decision on this issue corresponds
> perfectly with those who know enough to install a plugin to change the
> behaviour.
> 
> --
> Matt Mullenweg
>   http://photomatt.net | http://wordpress.org
> http://pingomatic.com | http://cnet.com
> 
> _______________________________________________
> hackers mailing list
> hackers at wordpress.org
> http://wordpress.org/mailman/listinfo/hackers_wordpress.org
> 


-- 
--Robert Deaton
http://anothersadsong.com


More information about the hackers mailing list