Plugin execution order

Development-related discussion, including bundled plugins
newsjunkie
Bear Rating Trainee
Bear Rating Trainee
Posts: 8
Joined: 16 Apr 2014, 00:46

Plugin execution order

Postby newsjunkie » 16 Jun 2016, 00:23

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

JustAMacUser
Bear Rating Overlord
Bear Rating Overlord
Posts: 373
Joined: 20 Aug 2013, 23:13

Re: Plugin execution order

Postby JustAMacUser » 16 Jun 2016, 00:30

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.

newsjunkie
Bear Rating Trainee
Bear Rating Trainee
Posts: 8
Joined: 16 Apr 2014, 00:46

Re: Plugin execution order

Postby newsjunkie » 16 Jun 2016, 15:14

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


Return to “Development”

Who is online

Users browsing this forum: Google [Bot] and 1 guest