I am new to WordPress plugin development. I have following codes for form method of plugin. When I enter anything in title field and save, it gives, Warning: extract() expects parameter 1 to be array, null given in /Applications/XAMPP/xamppfiles/htdocs/NGO/wp-content/plugins/messagner
public function form($instance)
{
extract($instance);
print_r($instance);
?>
<p>
<label for="<?php echo $this->get_field_id('title');?> ">Title</label>
<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 esc_attr($title); ?>"
/>
</p>
<p>
<label for="<?php echo $this->get_field_id('description'); ?>"></label>
<textarea
class = "widefat"
rows = 10
id = "<?php echo $this->get_field_id('description');?>"
name = "<?php echo $this->get_field_name('description'); ?>"
value = "<?php if(isset($description)) echo esc_attr($description); ?>"
>
</textarea>
</p>
<?php
}?>
I don't know where I am making some silly mistake please help. Thanks.
extractconverts an array to variables:extract(array("demo" => "Hello World"));is$demo = "Hello World";what makesprint_r($instance);? Please tell us the content. - Adrian Preuss$instancevariable that you are using inextract($instance);- jogesh_pi