0

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?

  • 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
1

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.
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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