[wp-hackers] Widget definitions inside classes

Sean Hickey seanhickey at gmail.com
Sat Aug 26 14:20:36 GMT 2006

> register_sidebar_widget('MyWidget', array(& $this, 'my_widget'));
> like
> add_filter('the_content', array(& $this, 'my_the_content_filter'));
> would be useful.

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

More information about the wp-hackers mailing list