• Resolved ben303

    (@ben303)


    Hi,

    just a quick question, I want to run another plugin (delete duplicate posts) after my feeds have been updated via cron.

    Where in your code is a safe spot to add some new code to call this other plugin AFTER updating feeds in feedwordpress has finished?

    cheers

    Ben

    • This topic was modified 4 years, 9 months ago by ben303.
Viewing 1 replies (of 1 total)
  • Plugin Author C. Johnson

    (@radgeek)

    Hi Ben,

    So, what I would usually advise here would be not to edit the core code of feedwordpress directly (such changes are easily lost or need to be done over again if you later install an upgrade; it’s easy to inadvertently make mistakes or do things with unexpected side effects; etc.).

    The best way to do this is to add some code of your own to your functions.php file (or to a small add-on plugin module, if you prefer) and then add that code as an action on the feedwordpress_update_complete event hook.

    FeedWordPress triggers a number of filter and action events using the standard WordPress plugin API in the course of running an update process, feedwordpress_update_complete being the hook that is triggered at the end of a scheduled update process. (It’s also the same hook that I typically use to trigger scheduled events in add-on modules for FWP that need to process recently imported posts or to clean up in some way after an update procedure.) Here’s an example of how you would do that:

    https://fwpplugin.com/wiki/feedwordpress_update_complete/

    Hope that answers your question! Let me know if the technique works for you.

Viewing 1 replies (of 1 total)
  • The topic ‘after cron job updating, want to trigger extra code. Where to put?’ is closed to new replies.