Making WordPress and the WpAudio Plugin Love Each Other Again

After upgrading to the latest and greatest version of , one of my favorite plugins stopped working correctly. , which is supposed to stream “in-line” any mp3 link I place on my site, was no longer behaving as it intended. Instead it was merely treating the mp3 links as a simple link and opening the file in a new window. Not cool.

After visiting the plugin’s author page it became quickly evident that no updates had been made — and in fact that no updates would be made. So I did I quick visit to the WordPress Forums and, thankfully, found that I was not the only person experiencing this issue. A solution had been found to the issue that required a modification of the plugin’s minified file. That change:

// Old and busted:
{jQuery('a[href$=.mp3]').addClass('wpaudio');}

// The new hotness (notice the quotes):
{jQuery('a[href$=mp3]').addClass('wpaudio');}

Sadly, this solution didn’t work for me as it did some others. As I poked around a little further, I saw my version of the plugin wasn’t using a minified version of the file, but rather the full file. I cracked it open, looked for the same command as above and sure enough, upon the same change the plug started working correctly for me again:


//Change line 425 from (again, notice the quotes):
jQuery('a[href$=.mp3]').addClass('wpaudio');

// to
jQuery('a[href$=".mp3"]').addClass('wpaudio');

It’s working again… just like magic:

I Don’t Want To Set The World On Fire

I Don’t Want To Set The World On Fire

Artist: The Ink Spots

Album: Fallout 3: Soundtrack

I didn’t really investigate too much into what actually caused the plugin to break, but I have a feeling it’s a direct result of WordPress using a different version of the jQuery library. If anybody knows for sure, let me know.