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?
Thanks
Plugin execution order
-
- Bear Rating Overlord
- Posts: 373
- Joined: 20 Aug 2013, 23:13
Re: Plugin execution order
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.
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.
-
- Bear Rating Trainee
- Posts: 8
- Joined: 16 Apr 2014, 00:46
Re: Plugin execution order
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.
Cheers
Cheers
Who is online
Users browsing this forum: No registered users and 3 guests