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 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
add comment

1 Answer 1

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
add comment

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.