How to call custom function after click on the metabox button ?
-
Hello.
I created metabox in function.php file which allow admin to download pdf file.
When admin clicks on button “Print”, pdf file generated and sent to browser.
Function that generates pdf attached to ‘woocommerce_process_shop_order_meta’ action, which triggered by clicking on button “Print”.
This is not convenient because action ‘woocommerce_process_shop_order_meta’ called everytime when admin updates order and every time pdf file downloaded. When button clicked i want only download pdf file and i want to call that function by clicking on that button, but do not know how to do it in right way. I’m looking in javascript/ajax way but may be there is better solution.Thank you, for patience and help.
- The topic ‘How to call custom function after click on the metabox button ?’ is closed to new replies.