Roots integration with Bootstrap Image Gallery and Blueimp Gallery

I’ve integrated a roots site partially successfully with Bootstrap Image Gallery http://blueimp.github.io/Bootstrap-Image-Gallery/

The issue is that when I create a gallery the lightbox carousel scrolls through all the images even if I have several galleries and I would like the lightbox to just scroll through the images of a specific gallery.

I have tinkered with the roots gallery.php and could achieve what I want if I could somehow get the $unique var from the roots_gallery function and use it in the roots_attachment_link_class function.

I just cannot find a way of getting the $unique value outside of the roots_gallery function to pass into the other one.

I’m no expert coder so was hoping someone could help.

Thanks

This isn’t a Roots question, it’s a PHP and WordPress question that also depends on two addons. Chances are low that you’ll get an answer here but you might get lucky.

I figured that may be the case so just posted on stackoverflow as well. I thought it was kind of roots specific though as the functions I have mentioned from the gallery.php file are roots specific. No doubt someone with more php knowledge than myself could probably find the answer, but they’d need to see the whole gallery.php file.