Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have written a plugin which lets the user upload file attachments for using wordpress as a download site.
So I have added a meta box which shows the user the files he has uploaded for every post. Every thing is working fine until I wanted to make it so that if a user uploads file using the built-in upload manager and then closes the ThickBox a function of mine is invoked to update that meta box for new files.

In simple words, I want to be able to listen on the ThickBox close event. That's it.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

When the thickbox gets closed it triggers 'tb_unload' (in earlier Wordpress version it was just 'unload' (not sure though) )

so you can do something like:

 $(window).bind('tb_unload', function() {
    //do stuff
});
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.