How to trigger an action after a post is made

Unsolved Technical Support
  • I would like to trigger a specific action after a user submits a post. How would you recommend I do this?

    I found an old post that references "fireHook", how could I use that to my advantage?

    plugins.fireHook('action:post.purge', pid, function () { // all plugins are done });

    In my case I don't want to purge a post but rather do something else.

    Where would I even put the code chunk?


  • @rod

    You can create a plugin that waits on the hook "" and fires a method that executes the custom action you define

        { "hook": "", "method": "customAction"  },

    Details on creating a plugin are available at Creating Plugins

Suggested Topics