[wp-trac] [WordPress Trac] #13786: Problems with the current register_uninstall_hook implementation
WordPress Trac
wp-trac at lists.automattic.com
Tue Jun 8 19:35:57 UTC 2010
#13786: Problems with the current register_uninstall_hook implementation
--------------------------+-------------------------------------------------
Reporter: x3r0ss | Owner: westi
Type: defect (bug) | Status: new
Priority: normal | Milestone: Unassigned
Component: Plugins | Version: 3.0
Severity: normal | Keywords: hooks, plugins
--------------------------+-------------------------------------------------
Comment(by x3r0ss):
Replying to [comment:15 jacobsantos]:
> Replying to [comment:13 x3r0ss]:
> > What I did was
> > {{{
> > register_uninstall_hook(__FILE__, array($this, "uninstall"));
> > }}}
>
>
> This is because the callback is serialized when it is put into
!WordPress and therefore will also include the class defined in $this.
Again, as it was stated in the last ticket, the object callback can be
used, but must be a static method or a function. The only unsupported
callback is that which you are using above.
Which I understand now but there's no documentation saying it's
unsupported as far as I know, and perhaps explicitly checking if they're
passing an object and throwing an exception if they do would be an
improvement.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/13786#comment:16>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list