[wp-hackers] how to do a single-instance widget with the new API
Raphaël Droz
raphael.droz at gmail.com
Fri Mar 19 09:56:52 UTC 2010
Otto wrote:
> Oops. Forgot. You can reference your number with $this->number.
>
> -Otto
>
(replying to your message as icedove/gmail still don't show mines)
I finally used :
add_action('wp_ajax_widget_callback', array(&$this, 'widget_php_callback'));
in the widget class constructor.
It works flawlessly and I no more need hidden $number field nor
get_option('last_instance')
there.
Raph
More information about the wp-hackers
mailing list