[wp-hackers] plugin loading order (rfc)

Jennifer Hodgdon yahgrp at poplarware.com
Sun Mar 11 19:26:51 GMT 2007


> Could you expand this issue / or link to an example of the problem.
> 
> I'm not sure how allowing control over the include order of plugins 
> gives people any benifit apart from wining in the pluggable function 
> definition battle.

I can think of one possible use. A plugin I use makes a multi-lingual 
blog, in part by having the locale of WordPress be dynamic. During the 
load, so that it happens as early as possible, the plugin figures out 
what language the user wants to view the blog in, and then sets the 
WordPress locale.

The problem is that other plugins could call load_plugin_text_domain 
during their load phase (to load their internationalization). So if 
they are loaded before the multilingual plugin, they will have loaded 
the wrong locale. Maybe there is some way to reset their text domain 
to the right locale, but I can't figure out a very smart way to do it. 
So ensuring that the multilingual plugin loads first would be good.

Or, ensuring that the plugins wait until later to call 
load_plugin_text_domain, but that is up to the plugin author...

     Jennifer


More information about the wp-hackers mailing list