WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a plug-in that allows for repeatable fields. There will be an image and the image description. The description allows for tinyMCE editing. There are obviously problems with this, but I think I have found a solution.

What I am trying to do is save the metadata after the user closes the thickbox and the image filed is populated. I'm wondering if there is an 'add_action' hook that I can use to accomplish this. Any ideas?

share|improve this question
You could only do this with ajax. Add an event handler. For a more detailed how-to, please refer to other questions tagged with ajax and jQuery event handler and .on( 'click', function()s. – kaiser Sep 19 '12 at 19:52
I actually ended up using the 'send_to_editor' method. – Greg Wiley Sep 20 '12 at 3:25
up vote 1 down vote accepted

I used the send_to_editor method in JavaScript. The end result ended up looking like this:

window.send_to_editor = function(html) { 
        // logic to save via AJAX goes here.
share|improve this answer

Your Answer


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.