[wp-hackers] Plugin deactivation
David Chait
davebytes at comcast.net
Tue Jul 5 03:06:27 GMT 2005
Actually, Robert's original question was ordering the loading/initialization of plugins, and not the order that filters/actions get executed... Also, if I remember the code, you can actually go outside of (1, 10) bounds with the order/priority param... and the numbers are quite useless with a hundred people writing different plugins, and using the numbers differently (or not at all!). Gee, sounds like the same problem with user levels. ;) ;)
Having some control over order of loading (and thus initialization/early-execution) would definitely be a good thing, and defined by categories (roles!), rather than numeric index.
-d
----- Original Message -----
From: Amit Gupta
To: wp-hackers at lists.automattic.com
Sent: Monday, July 04, 2005 2:33 PM
Subject: Re: [wp-hackers] Plugin deactivation
well, as I know of it, the application orders for the filters are there for the sole purpose of specifying which plugin runs first. Like
add_filter('the_content', 'my_plugin', 1);
this will make my plugin run first, if the sequence order is not specified then its defaulted to the last in the order, 10. I believe this was made so that like you said, plugins that want to stop the execution of other code can run first, and so on. however I don't think that this feature is used optimally by plugin-authors(myself included as I had my syntax hiliting plugin running at #1 in first versions, but now I've 2 filters at #3 & #4).
so IMHO, plugin authors need to understand that and use it, instead of just whipping up a quick hack. for that I think that there should be a page at the Codex stating the basic essential guidelines that the plugins must follow. though I know it can't be controlled, but to some extent it can be controlled. As wp-plugins.org is under control of WP, I suggest that it should be mandatory for all plugins listed there to follow the basic essential guidelines.
just my $0.02
-----
Amit Gupta
|| Canned!! -- my Atropine || iG:Syntax Hiliter v3.0 ||
|| iGEEK.INFO || Free Nokia Ringtones || Online Gaming @ Games Planet ||
---------- Original Message from davebytes at comcast.net ----------
Wouldn't it be easiest (and completely under your control) to have all the sub-plugins register off a custom message/action (init_any_blah_plugins), and then have the 'master' register for the plugins_loaded action, and when that gets hit do_action(init_any_blah_plugins)?
I agree that some priority ordering would be nice -- i.e., CG-Referrer would love to run first, as it may potentially 'bounce' access, and thus would like to short-circuit other plugin code loading. Unfortunately, then EVERYONE fights for who really needs to run first. ;) we might need 'classes' of plugins, so that things that want to prevent other code execution can run first, things that control secondary code loading/execution (chaining, whatever) run second, and 'normal' plugins can run third (oh, and 'late' plugins run fourth, as there's a class of things that want to run after all other plugins have hooked in...). But this goes both for initial loading and hooking off of plugins_loaded...
-d
------------------------------------------------------------------------------
_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://comox.textdrive.com/pipermail/wp-hackers/attachments/20050705/0767ec93/attachment.html
More information about the wp-hackers
mailing list