MapMyGlobe

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.

3 Responses to “diggIT Wordpress Plugin Fix”

  1. Asif Nawaz Says:

    Where do we define the filter? Does it go in the plugin file or in the wordpress theme file?

  2. Julien Says:

    Yes, at the beginning of the plugin file.

  3. Asif Nawaz Says:

    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.

Leave a Reply