[wp-hackers] Plugin deactivation

Robert Deaton false.hopes at gmail.com
Mon Jul 4 15:53:41 GMT 2005


While on the topic of plugins and dependancy plugins, is there any chance 
that we can add a priority hook for plugins, so that plugins that may or 
will have plugins that depend upon it can ensure that they are loaded first, 
or at the very least that the dependancies can specify to be loaded later 
on, this way no fancy hooking around init or the like is required like I've 
been hacking to do in 1.5.

On 7/4/05, Ryan Boren <ryan at boren.nu> wrote: 
> 
> On Sun, 2005-07-03 at 23:35 -0400, Scott Merrill wrote:
> > Ryan Boren wrote:
> > > On Sun, 2005-07-03 at 22:02 -0400, Robert Deaton wrote:
> > >
> > >>I agree that we need activation and deactivation hooks, and its a
> > >>shame that it was pushed aside for 1.5.1 because its a feature I know
> > >>a lot of plugin authors really would have liked to seen included. Is
> > >>there any chance of getting the patch attached to 1052 included in the
> > >>core?
> > >
> > >
> > > Not that particular patch. Every plugin listening for those events 
> will
> > > get them and think they are activating/deactivating. It's a broadcast
> > > to all plugins. Won't work.
> >
> > If you pass the name of the plugin as a parameter to the (de)activation
> > hook, couldn't plugins just pay attention as necessary?
> 
> Sure, but that would make the plugins more complicated and fragile. The
> whole process can be hidden behind one function call.
> 
> > I can envision modest automated plugin dependency chains. For example,
> > de-activating my WP-Cron plugin should also deactivate all the helper
> > plugins it enables.
> > Yes, the helper plugins should rely on
> > `if (function_exists(WP-Cron stuff) { ... }`
> > but they'll still be left active, cluttering the plugin list for no good
> > reason.
> 
> Plugins can negotiate their own dependencies. WP-Cron can send an "I'm
> going down" event from its deactivation hook.
> 
> > Skimming the older proposed patch, I looks like it supports all the
> > above, just as well.
> 
> Patch updated for 1.6.
> 
> Ryan
> 
> 
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> 
> 
> 
> 


-- 
--Robert Deaton
http://somethingunpredictable.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://comox.textdrive.com/pipermail/wp-hackers/attachments/20050704/a983a393/attachment.html


More information about the wp-hackers mailing list