A: 
cmsPlugin.func = function(myCustom, cmsPlugin) { return function() {
        cmsPlugin.func();
        myCustom.func();
    };
}(myCustom, cmsPlugin);
Lucho
Thanks, will give this a shot now :)
Chris Burgess
I just added a second parameter to the first anon func, I think it might be needed.
Lucho
I had no luck with this. Here's the modified version I was trying - I probably confused things by trying to make my question generic.
Chris Burgess
+2  A: 

You cannot bind event listeners to a function. Events are bound and triggered from DOM nodes, so you need to know how to select the lightbox's markup.

The cleanest way I can think of to accomplish this would be to wrap the Lightbox.updateNav function and fire a custom event.

(function(){
  var _updateNav = Lightbox.updateNav;

  Lightbox.updateNav = function () {
    $("#lightbox").trigger('lightbox.updateNav');
    _updateNav.apply(this, arguments);
  }
})();

#lightbox needs to point to the lightbox markup that you can bind event listeners to. I don't know enough about LightBox2's API to tell you how to do this exactly.

This is better than a simple wrapper function because you can wire up as many listeners as you like.

$("#lightbox").bind('lightbox.updateNav', function() {})

Since the lightbox markup is likely created and destroyed dynamically, you would be better off using delegate instead (provided you have access to jQuery 1.4.2). If you can identify where the markup is inserted, attach a delegate to the parent element:

$('#lightbox-parent').delegate('#lightbox', 'lightbox.updateNav', function() {})

This is much better performance than .live() so I would recommend doing it this way if you can.

Adam Lassek
Thanks Adam. I tried both this and Lucho's modified answer below. Yours worked and is much appreciated. I'll update the question with my final code now.
Chris Burgess