Temporary Fix for Regenerate Thumbnails 2.0.3

Posted on 2010/11/04 Comments

I was building a WordPress a theme, and I needed to rebuild the post attachment thumbnails. As usual, I used Alex’ amazing Regenerate Thumbnails plugin. Upon clicking the button, I got nothing. No progressbar, nothing. I checked the attachment directory and found that the thumbnails weren’t rebuilt.

So I looked at Firebug console and found an error thrown, $.widget is not a function and I realized that I was using the trunk version of WordPress. It throws an error because WordPress just got its jQuery and jQuery UI scripts updated to the latest versions. Also, the ‘widget’ part of jQuery UI is now has its own handler, ‘jquery-ui-widget‘ while previously it was part of ‘jquery-ui-core‘ (I believe).

The fix is easy, you can follow these steps:

  1. Download the newest jQuery UI bundle and unpack it.
  2. Copy the new jquery.ui.progressbar.js (located in the development-bundle/ui/ directory) into the Regenerate Thumbnails plugin directory (wp-content/plugins/regenerate-thumbnails/jquery-ui/).
  3. Open the plugin script (regenerate-thumbnails.php) with your favorite editor and edit line 59 with this:
    wp_enqueue_script( 'jquery-ui-progressbar', plugins_url( 'jquery-ui/jquery.ui.progressbar.js', __FILE__ ), array('jquery-ui-core', 'jquery-ui-widget'), '1.8.5' );
  4. Now you can rebuild your thumbnails.

Because this problem only occur when running the trunk version of WordPress, I don’t think the plugin needs to be updated (yet). I’m sure Alex will update it when WordPress 3.1 come out and I’ll be sure to remind him. He usually responds quickly, so no need to worry :)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>