widget form method in wordpress -
i need help.
i have code
<?php class messenger extends wp_widget { function messenger() { $widget_ops = array('classname' => 'messenger', 'description' => 'displays messages users' ); $this->wp_widget('messenger', 'messenger', $widget_ops); } public function form($instance) { extract($instance); ?> title <input class="widefat" id="<?php echo $this->get_field_id('title') ?>" name="<?php echo $this->get_field_name('title')?>" value="<?php if(isset($title)) echo $title; ?>" /> <?php } public function update() { } public function widget() { } } add_action( 'widgets_init', function(){return register_widget("messenger");});?> but unfortunately error occurred warning: extract() expects parameter 1 array, null given in c:\wamp\www\pt\wp-content\plugins\messenger\messenger.php on line 22 not know why, not know why $instance keep null after submit form.
Comments
Post a Comment