Need help to fix my Plugin code


#1

This codes bellow not working in dashboard:

class JW_options {
public function __construct()
{
$this->register_settings_and_field();
}

public function add_menu_page()
{
    add_options_page('Theme Options', 'Theme Options', 'administrator', __FILE__, array('JW_options', 'display_options_page'));
}
public function display_options_page()
{
    ?>
   <div  class="wrap">
       <?php screen_icon(); ?>
       <h2>MY Theme Options</h2>
       <form method="post" action="options.php" enctype="multipart/form-data">
           <?php settings_field('jw_plugin_options'); ?>
           <?php do_settings_sections('__FILE__'); ?>
       </form>
   </div>
    <?php
}

public function register_settings_and_field()
{
    register_settings('jw_plugin_options', 'jw_plugin_options');
    add_settings_section('jw_main_section','Main Settings', array($this, 'jw_main_settings_cb'),__FILE__);
    add_settings_field('jw_banner_heading','Banner Heading:', array($this, 'jw_banner_heading_setting'),__FILE__, 'jw_main_section');
}

public function jw_main_settings_cb()
{
    //Nothing now
}

public function jw_banner_heading_setting()
{
    echo '<input />';
}

}

add_action(‘admin_menu’, function(){
JW_options::add_menu_page();
});

add_action(‘admin_init’, function(){
new JW_options();
});