Re: IMPORTANT — Plugin Devs – Read this
hi Ray
plugins_loaded is the standard action which gets called when all the active plugins’s source code is included(loaded) by wordpress, so It tells you that all the plugins are ready, and you can call your functions now.
The advantage of using “plugins_loaded” action is that, it is the first action hook which gets called after your(/all other active plugins source code is loaded by wordpress) , so You can be sure your code is called quiet before anything else happens.
Investigate wp-settings.php for more.
JJJ has proposed a nice solution with the bp_init action(just introduced in the r2472).
Because wordpress does not guarantees which plugin gets loaded first( it has something like, the plugins consisting of bare files are loaded first, the the plugins which are inside their own directory loaded alphabetically, AFAIK,It might have changed recently), So a plugin which is dependent on buddypress, will have many issues detecting bp is loaded or not.
So, JJJ’s solution helps there as all the buddypress methods which are called on plugins loaded action have priority less than default(less means higher priority), so if we hook to bp_init, we can be sure buddypress is loaded and you are still calling at the same action, I am already trying my hand with this, and it seems to be working,still testing though.
btw, if you have your plugins, which uses the hook “plugins_loaded” and has priority greater than 10, i.e 11 or anything else, you don’t need to worry about this change.