[wp-hackers] Widget definitions inside classes

Jamie Talbot wphackers at jamietalbot.com
Sun Aug 27 05:23:19 GMT 2006

Sean Hickey wrote:
> I think what you're looking for is:
> register_sidebar_widget('MyWidget', array('MyClass', 'my_widget'));
> You can call static class methods using array('TheClass', 'TheMethod')
> - Sean

Thanks for that, though, as I mentioned before, static methods are no use in this case because I'd
like access to $this.  Guess it's not possible - will probably encapsulate it as Alex suggested with
a wrapper function.  This would be a nice addition to the Widgets plugin, though...




More information about the wp-hackers mailing list