Unsolved How to trigger an action after a post is made


  • 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?

    Thanks.


  • @rod

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

        { "hook": "action:post.save", "method": "customAction"  },
    

    Details on creating a plugin are available at Creating Plugins


Suggested Topics

  • 1
  • 3
  • 14
  • 6
  • 5
| | |