I want to capture the click event on the "Save all changes" button?
Is there any callback method like there is when you click (window.send_to_editor) the "Insert into Post" button
I want to capture the click event on the "Save all changes" button?
Is there any callback method like there is when you click (window.send_to_editor) the "Insert into Post" button
Share Improve this question asked Aug 6, 2015 at 15:31 vlatkorunvlatkorun 1214 bronze badges 3- 2 Could you maybe use jQuery to add an event listener to the save all changes button based on its class when the modal is opened? – Moose Commented Apr 5, 2016 at 15:31
- 2 how old is this WordPress version? – seot Commented Sep 6, 2016 at 12:01
- @seot I have seen this upload UI in newest versions of WP. It seems to still be available for plugins to use. – Dan. Commented Nov 27, 2016 at 16:03
2 Answers
Reset to default 1I don't think there is. You will have to use some local (browser-based) Javascript code to attach a function to the on-click event of the button.
(Not a Javascript expert, but perhaps this will point you in a direction of investigation.)
You should got a class for that button Try to find it and, if exists, you can fire event i.e using jQuery:
jQuery(".button-class").click(...);