• Resolved dz0ny

    (@dz0ny)


    I’ve developed custom plug-in for displaying advertisements, one of the settings pages inside custom admin menu is using the settings_fields API, to save options. Problem is because admin user can save them, but editor can’t.

    Questions:
    1. Is this API meant only for admins?
    2. How to change that, hacking the options API?
    3. Is there some sort clash with ADminize plugin which I also use?

    Thanks!

    Here is the code:

    <form method="post" action="options.php">
        <?php settings_fields( 'obvestilo-nast-g' ); ?>
        <table class="form-table">
    
            <tr valign="top">
            <th scope="row">Naslov obvestila</th>
            <td><input type="text" name="naslov" value="<?php echo get_option('naslov'); ?>" /></td>
            </tr>
    
            <tr valign="top">
            <th scope="row">Besedilo obvestila</th>
            <td><textarea name="besedilo" rows="8" cols="40"><?php echo get_option('besedilo'); ?></textarea></td>
            </tr>
    
        </table>
    
        <p class="submit">
        <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
        </p>
    
    </form>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The options.php file requires a user to have the manage_options capability. So the answer to #1 is yes, it is part of the API. Only the admin role has the manage_options capability. You might want to look at Justin Tadlock’s Members plugin. This plugins will allow you to assign capabilities to user roles that don’t normally have them, or for you to make custom roles, and assign those roles to users.

    Thread Starter dz0ny

    (@dz0ny)

    Many, many thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘User with Editor role, cannot save options’ is closed to new replies.