Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Tim W

    (@timwhitlock)

    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

    (@timwhitlock)

    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. (loco_admin_shutdown now compliments loco_admin_init)

    Try this example code:
    https://gist.github.com/timwhitlock/0b5a83c1b632713713c6c5395318bded

    Plugin Author Tim W

    (@timwhitlock)

    Update: The loco_admin_shutdown is now live in v2.2.0.

    Thread Starter kkoyan

    (@kkoyan)

    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.