Editor can't edit options
-
Hi there,
I’m using the following code to add an options panel to my site. Administrators can view the options page and make changes. However, editors can not – they can view the page, but when they try to save anything, they just get greeted with the Cheatin’ uh?” error message. I would just change their role, however I’m using another plugin were they have to be editors.
Any advice on letting them save settings?
// Hook in add_action('admin_menu', 'mv_admin_menu'); // Add admin menu for options function mv_admin_menu() { add_menu_page('my settings title', 'Settings', 'edit_posts', 'mv_options_page', 'mv_options_page'); add_action('admin_init', 'mv_register_settings'); } // Register the settings function mv_register_settings() { register_setting('xx-options-group', 'xxx_opt1'); } // Output the options page function mv_options_page() { ?> <div class="wrap"> <h2>Moors Valley Settings</h2> <?php if($_GET['settings-updated']==true) { echo '<p><strong>You changes have been saved.</strong></p>'; } ?> <form method="post" action="options.php"> <?php settings_fields('xx-options-group'); ?> <table class="form-table"> <tr valign="top"> <th scope="row">Option 1:</th> <td><input style="width:300px;" type="text" name="xxx_opt1" value="<?php echo get_option('xxx_opt1'); ?>" /></td> </tr> </table> <p class="submit"> <input type="submit" class="button-primary" value="Save Changes" /> </p> </form> </div> <?php }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Editor can't edit options’ is closed to new replies.