[Plugin: NextGEN Gallery] Thickbox breakage after upgrade to WP 3.2.1 [solution]
-
I figured I’d share this in case anyone else experienced this problem. I believe the issue is, at its heart, a change in Thickbox behavior, but I’m not 100% sure. I blogged this same thing on my site, but wanted to try to get it in front of the developers (who don’t appear to have a contact form on this site).
The long story boiled down is that the ThickBox can find a “group” of images if you pass it common name in the rel param in your a a tag. For instance:
<a href=”https://mikebrum.com/full_image.jpg” class=”thickbox” rel=”anyString”><img src=”https://mikebrum.com/thumb_image.jpg” /></a>
That’s simple enough. Any link that has the rel param set to “anyString” will be shown with Thickbox having “next” and “prev” links so you don’t have to view, close, open the next by hand.However, if the rel param happens to have a space in it, this appears to break completely, resulting in the image not being displayed (you just get that “loading” bar that never completes).
The fix is rather simple. In <your_WP_root>/wp-content/plugins/nextgen-gallery/lib/image.php, find the line:
function get_thumbcode($galleryname = ”) {
Immediately under that, add the following two lines:
// Fix thickbox failure when $galleryname has a space in it $galleryname = preg_replace( ‘/\s+/’, ”, $galleryname );
And that’s it. That strips the whitespace from the $galleryname variable which is what’s passed on to the code that populates the rel param in image links for Thickbox.
Just keep in mind that if you make this change on your server, your changes will be overwritten when you perform your next update — so make a note and be sure to apply this fix again after you upgrade.
- The topic ‘[Plugin: NextGEN Gallery] Thickbox breakage after upgrade to WP 3.2.1 [solution]’ is closed to new replies.