Title: Webhook after saving files
Last modified: November 15, 2018

---

# Webhook after saving files

 *  Resolved [kkoyan](https://wordpress.org/support/users/kkoyan/)
 * (@kkoyan)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/webhook-after-saving-files/)
 * We run loco translate in a kubernetes setting, where the webheads are ephemera.
   We want to sync the generated files to a google storage bucket after they get
   generated. In order to do that we looked if Loco calls any webhook after saving
   the files. (Then we can trigger our sync job using that hook).
    Is it possible
   to add a hook at: [https://github.com/loco/wp-loco/blob/master/src/ajax/SaveController.php#L110](https://github.com/loco/wp-loco/blob/master/src/ajax/SaveController.php#L110)?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * (@timwhitlock)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/webhook-after-saving-files/#post-10884361)
 * Hi, and thanks for your suggestion.
 * Webhooks are on the road map for the main Loco service, which eventually will
   be integrated into the Loco Translate plugin. Git hooks are also planned.
 * However, I don’t intend to add such advanced features directly into the WordPress
   plugin code, as these will become “Pro” features requiring Loco API integration.
   If you need Webhooks now I suggest either forking the plugin, or watching a WordPress
   hook.
 * The latter should be quite easy to do. All Loco Translate Ajax operations trigger`
   wp_ajax_loco_json`. The post data for a save operation will then contain route
   =save. You could ping a webhook on this, but note that the file will not yet 
   be saved. I’d use this trigger to bind another callback to a shutdown hook.
 *  Plugin Author [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * (@timwhitlock)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/webhook-after-saving-files/#post-10884595)
 * Further to this, I realise that there is no shutdown function you can use, so
   I’ve added a new hook in the [development version](https://localise.biz/wordpress/plugin/developers).(
   loco_admin_shutdown now compliments loco_admin_init)
 * Try this example code:
    [https://gist.github.com/timwhitlock/0b5a83c1b632713713c6c5395318bded](https://gist.github.com/timwhitlock/0b5a83c1b632713713c6c5395318bded)
 *  Plugin Author [Tim W](https://wordpress.org/support/users/timwhitlock/)
 * (@timwhitlock)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/webhook-after-saving-files/#post-10885693)
 * Update: The loco_admin_shutdown is now live in v2.2.0.
 *  Thread Starter [kkoyan](https://wordpress.org/support/users/kkoyan/)
 * (@kkoyan)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/webhook-after-saving-files/#post-10886395)
 * Thanks for the suggestions, and for looking into it and adding the shutdown function.
   Superb!
 * > Git hooks are also planned.
    Now you have me hooked. When this happens, we 
   are very interested in the PRO service.
 * Be well, and thanks again,
    Konstantinos

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Webhook after saving files’ is closed to new replies.

 * ![](https://ps.w.org/loco-translate/assets/icon-256x256.png?rev=1000676)
 * [Loco Translate](https://wordpress.org/plugins/loco-translate/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/loco-translate/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/loco-translate/)
 * [Active Topics](https://wordpress.org/support/plugin/loco-translate/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/loco-translate/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/loco-translate/reviews/)

## Tags

 * [hook](https://wordpress.org/support/topic-tag/hook/)
 * [integrations](https://wordpress.org/support/topic-tag/integrations/)

 * 4 replies
 * 2 participants
 * Last reply from: [kkoyan](https://wordpress.org/support/users/kkoyan/)
 * Last activity: [7 years, 6 months ago](https://wordpress.org/support/topic/webhook-after-saving-files/#post-10886395)
 * Status: resolved