I'm trying to create an admin menu for my theme using the add_menu_page() function. It seems somewhat okay but when I save the option, I'm getting a new page with the error message: "Error: options page not found.".
Please help me to figure out what I made mistake. Below is the full code of neo-settings.php (which is included through the functions.php). Thanks in advance :)
<?php
class abooze
{
function abooze()
{
add_action('admin_menu', array(&$this, 'my_admin_menu'));
}
function my_admin_menu()
{
add_menu_page('Neotone framework options', 'Neotone', 'add_users','neo_options', array(&$this,'overview'), get_bloginfo("template_url") .'/images/icon.png');
}
function overview()
{
// here is the code for creating my option field
add_action( 'admin_init', 'register_mysettings' );
function register_mysettings() {
register_setting( 'myoption-group', 'my_option_name' );
}
?>
<div class="wrap">
<h2> Theme Option Panel</h2>
<form method="post" action="options.php">
<?php settings_fields( 'myoption-group' ); ?>
<input type="text" name="my_option_name" size="80" value="<?php echo get_option('my_option_name'); ?>" />
<p class="submit">
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
</p>
</form>
</div>
<?php
}
}
$abooze_object = &new abooze();
?>