There's a few questions on this site referencing this issue and I've read them and applied the proposed solutions to no avail.
I've made a very simple theme options page that appears for the Editor role but when an Editor tries to save the options they get the "Cheatin 'Uh?" message.
The following is my options code:
<?php
function map_register_settings() {
add_option( 'map_zoom', '1');
add_option( 'map_longitude', 'alpha');
register_setting( 'default', 'map_zoom' );
register_setting( 'default', 'map_longitude' );
register_setting( 'default', 'map_latitude' );
}
add_action( 'admin_init', 'map_register_settings' );
function map_register_options_page() {
add_theme_page('Map Center', 'Map Center', 'edit_theme_options', 'map-options', 'map_options_page');
}
add_action('admin_menu', 'map_register_options_page');
function map_options_page() {
?>
<div class="wrap">
<h2>Map Center Options</h2>
<form method="post" action="options.php">
<?php settings_fields( 'default' ); ?>
<table class="form-table">
<tr valign="top">
<th scope="row"><label for="map_zoom">Zoom Level (1 - 21):</label></th>
<td>
<input type="text" id="map_zoom" name="map_zoom" value="<?php echo get_option('map_zoom'); ?>" />
</td>
</tr>
<tr valign="top">
<th scope="row"><label for="map_latitude">Latitude:</label></th>
<td><input type="text" id="map_latitude" name="map_latitude" value="<?php echo get_option('map_latitude'); ?>" /></td>
</tr>
<tr valign="top">
<th scope="row"><label for="map_longitude">Longitude:</label></th>
<td><input type="text" id="map_longitude" name="map_longitude" value="<?php echo get_option('map_longitude'); ?>" /></td>
</tr>
</table>
<?php submit_button(); ?>
</form>
</div>
<?php
}
?>
I've also added the following to my functions file in an attempt to give the editor role the necessary capability:
//ALLOW EDITOR TO CHANGE MAP CENTER
// get the the role object
$editor = get_role('editor');
// add $cap capability to this role object
$editor->add_cap('edit_theme_options');