WordPress.org

Ready to get started?Download WordPress

Forums

Allow Editor role to save custom options (4 posts)

  1. leggo-my-eggo
    Member
    Posted 5 years ago #

    I'm trying to create a custom admin page, which is no problem, however, I'd like to allow the editor role to save the custom options, and I'm getting the "Cheatin' uh?" error. I have made the custom admin page available to the editors as follows:

    add_action('admin_menu','my_options_menu');
    function my_options_menu() {
      add_options_page('My Options', 'My Options', 'edit_others_posts', __FILE__, 'my_options_page');
    }
    function my_options_page() { ?>
      <form method='post' action='options.php'>
      ...etc...
      <?php settings_fields('my_options');
      </form>
    <?php }

    I think the reason that Editors are not able to save the options is because they don't have "manage_options" capabilities, but I don't know how to work around that, because I don't want to give them that capability.

    Can anyone help me through this?

  2. WayneSmallman
    Member
    Posted 4 years ago #

    I'm having exactly the same problem with my own Plugin.

    Everything worked fine on 2.6, but since the nightmarish process of figuring out how to get it to work wit 2.7+ I've now got this to contend with.

    I can see a couple of other Plugins I'm using are working with level 5 roles for Editors, but it's choking on mine and I don't know why. As I said, everything worked fine on 2.6

  3. psm9640
    Member
    Posted 4 years ago #

    Count me 3 - I think it's something happening after the submit action but if there's a hidden field for authentication, I've yet to come across any blog/forum posts on it. Hopefully someone in the know eventually responds.

  4. psm9640
    Member
    Posted 4 years ago #

    Well for my purposes guys I just needed to be able to create a textarea where someone could update a brief message on the home page. To that end, I just used a dashboard widget and it worked for my editor level requirements.

    Is it possible that by it's very definition of "admin_menu" that you can't get around permissions on saving? Wish there was more clarification/better tutorials on this...

Topic Closed

This topic has been closed to new replies.

About this Topic