MyBB Community Forums
Change load order of Plugins - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Development (https://community.mybb.com/forum-68.html)
+---- Thread: Change load order of Plugins (/thread-224269.html)



Change load order of Plugins - Darak - 2019-08-14

Hi, i made a couple of plugins that add/use info from the database. The problem is that i have 1 plugin to set the database info and other one to use  the database. If the second one dont find info, just create the info by default. If i use the 2 plugins at the same time, the first one to execute its the one which use the info, so the other one have nothing to do. 

Im using the hook for message, and it changes a code [plugin1] for html code like a bbcode but with database info. So, how can i change the load order of the plugins? where its the file that changes wich pluging executes first and this kind of things? I need that if a user puts [plugin1] [plugin2], the plugin1 executs before plugin2, but now use first plugin2

Ty for help


RE: Change load order of Plugins - Devilshakerz - 2019-08-14

Plugins are loaded as they appear in the plugins cache's active array (which can be inspected in ACP's Tools & Maintenance → Cache Manager) - new values are simply appended to it upon activation, so re-activating the plugin that should be loaded last might help.

This is not the recommended solution, though - usually it's possible to resolve such problems by using different hooks or hook priorities: https://docs.mybb.com/1.8/development/plugins/basics/#other-hook-options


RE: Change load order of Plugins - Darak - 2019-08-14

Ty for help, the hook priority fix it. Have a nice day