[wp-hackers] Editing the Comment Reply Link
David Law
wp-hackers at google-adsense-templates.co.uk
Thu Dec 16 11:15:18 UTC 2010
On Tue, 14 Dec 2010 21:48:38 -0600, you wrote:
>On Tue, Dec 14, 2010 at 6:41 PM, David Law
><wp-hackers at google-adsense-templates.co.uk> wrote:
>> This removes the text nofollow from a comments body. This works as
>> expected. Going to try to use the concept to replace fully formed HTML
>> links from the body of comments and leave something like
>
>Why not just do this?
>
>remove_filter( 'pre_comment_content', 'wp_rel_nofollow', 15);
I'm looking for the ability to remove fully formed HTML links so
convert:
<a href="http://www.domain.com/">Anchor Text</a>
and derivatives, to something like
http://www.domain.com/ : Anchor Text
I'm using a plugin (http://ducedo.com/remove-links-in-comments/) that
prevents text URLs from being converted to full links
WordPress by default converts http://www.domain.com/ to
<a href="http://www.domain.com/"
rel="nofollow">http://www.domain.com/</a>
The above plugin turns that off, so http://www.domain.com/ stays
http://www.domain.com/ (just text, so no nofollow links).
If I can get the above working (stripping HTML from fully formed
links), after WordPress 3.1 is released my theme will only need the
plugin above to have a WordPress site with no nofollow links. Also
going to give the option to follow links as well, so the above filter
will probably come in handy.
Not started the above yet (I don't expect to have any big problems
stripping the HTML code from links), still scratching my head over
removing the nofollow from the reply to comments links (not very
important as 3.1 fixes the problem). I'm sure you already know the
filter you suggested won't work on the nofollow of the reply to
comments links because the nofollow attribute is hard coded in
/wp-includes/comment-template.php was hoping I could use a simple
str_replace on the Reply links, but not getting it to work.
David
--
Monetize your WordPress blog with Search Engine Optimized templates
including AdSense ads http://www.google-adsense-templates.co.uk/
>-Otto
>_______________________________________________
>wp-hackers mailing list
>wp-hackers at lists.automattic.com
>http://lists.automattic.com/mailman/listinfo/wp-hackers
More information about the wp-hackers
mailing list