diggIT Wordpress Plugin Fix
When looking for a Digg plug-in to Wordpress you really have a lot of alternatives. As the set of functionalities offered by plug-ins of this kind does not vary much, and as the wanna-be blogger does probably not want to spend hours on this decision, you’ll probably end up picking one without much thought and just try it out. That’s what I did with this one, which is decent. However there is (as of today) a small bug which leads to a javascript error when the post’s excerpt contains line feeds.
The solution is to define a Wordpress filter, e.g.:
function sanitize_digg_excerpt($s){
return str_replace(array("r","n"), "", $s);
}
add_filter('the_excerpt_rss', 'sanitize_digg_excerpt');
I did mention this trick to the plugin developer, but as he didn’t respond nor has a comment page on his website I thought I’d write it down here.
February 16th, 2008 at 4:52 am
Where do we define the filter? Does it go in the plugin file or in the wordpress theme file?
February 16th, 2008 at 9:59 am
Yes, at the beginning of the plugin file.
February 17th, 2008 at 4:20 am
Hmmm…somehow it didn’t do the trick for me. I’ve switched to the I Love of Social Bookmarking plugin. Doesn’t give you the number of diggs, but it sort of does the trick.
Asif.