Page 1 of 1

Plugin execution order

Posted: 16 Jun 2016, 00:23
by newsjunkie
If I have two plugins that both use HOOK_ARTICLE_FILTER, is there anyway to specify the execution order? For example, if I want to use af_Readability to first get full article content, then have a second plugin run analysis on that retrieved full content?


Re: Plugin execution order

Posted: 16 Jun 2016, 00:30
by JustAMacUser
System plugins (defined in config.php) are hooked in the order they're declared (first in, first out).

User plugins (checked in the Preferences/Plugins) I'm not sure about, but I think they're run in the order they're listed so if you rename a plugin to appear alphabetically before/after another one, that should do the trick.

I've gotten in the habit of prefixing all my custom plugins with "z_" and putting them in config.php in the order I want. This way I know they'll fire in the order I want, can easily pick them out of the list, and if I do ever need to create a non-system one, it shows up at the end of the plugin list.

Re: Plugin execution order

Posted: 16 Jun 2016, 15:14
by newsjunkie
Thanks for the great reply - just tested and you're right: user plugins execute in alphabetical order. The z_ is a good idea to force that ordering.