Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Senior Member Harmonic's Avatar
    Join Date
    Jan 2011
    Location
    Toronto
    Posts
    291
    Member #
    26468
    Liked
    23 times
    Hello all, I need some help! Basically I created a theme options page so that a client with user account level Editor can edit options of the theme to replace general text of the homepage.

    Everything works beautifuly when i'm logged in as an admin, however when my client is logged in and makes a change to the options page and saves, she gets this error

    You do not have sufficient permissions to access this page
    I know what you're thinking. Harmonic you noob, she doesn't have permissions to access the page, obviously!

    The thing is that she DOES! Despite the error message declaring her lack of access permissions, the changes she makes ARE saved and reflected correctly on the homepage. Everything works great, except for the error message.

    Here is a snippet of my code. As you can see, the permissions are set to "edit_pages", which she can do...

    Code:
    add_menu_page($themename." Options", "".$themename." Options", 'edit_pages', basename(__FILE__), 'mytheme_admin');
    Why is this message coming up for her, and how can I remove it?

  2.  

  3. #2
    Senior Member Harmonic's Avatar
    Join Date
    Jan 2011
    Location
    Toronto
    Posts
    291
    Member #
    26468
    Liked
    23 times
    If no one can help, can someone direct me to where I can find it?
    Posted this on the WordPress.org support forum and no replies there either.

  4. #3
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    Perhaps the permissions in question are the file permissions on the server. Have you checked those?
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  5. #4
    Senior Member Harmonic's Avatar
    Join Date
    Jan 2011
    Location
    Toronto
    Posts
    291
    Member #
    26468
    Liked
    23 times
    yup, and like I said, the changes are being saved and correctly displayed. The problem is that Wordpress is giving her a false permissions error

  6. #5
    WDF Staff RickM's Avatar
    Join Date
    Jun 2010
    Posts
    593
    Member #
    2
    Liked
    16 times
    Can you post more code if its custom, or at least the names of the modified files - without those we're just stabbing in the dark.

    Cheers

  7. #6
    Senior Member Harmonic's Avatar
    Join Date
    Jan 2011
    Location
    Toronto
    Posts
    291
    Member #
    26468
    Liked
    23 times
    sure, the file is as stated, functions.php

    more code that may be helpful is:

    function mytheme_add_admin() {

    global $themename, $shortname, $options;

    if ( $_GET['page'] == basename(__FILE__) ) {

    if ( 'save' == $_REQUEST['action'] ) {

    foreach ($options as $value) {
    update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }

    foreach ($options as $value) {
    if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }

    header("Location: themes.php?page=functions.php&saved=true");
    die;

    } else if( 'reset' == $_REQUEST['action'] ) {

    foreach ($options as $value) {
    delete_option( $value['id'] ); }

    header("Location: themes.php?page=functions.php&reset=true");
    die;

    }
    }

    add_menu_page($themename." Options", "".$themename." Options", 'edit_pages', basename(__FILE__), 'mytheme_admin');

    }

    <p class="submit">
    <input name="save" type="submit" value="Save changes" />
    <input type="hidden" name="action" value="save" />
    </p>
    </form>
    <form method="post">
    <p class="submit">
    <input name="reset" type="submit" value="Reset" />
    <input type="hidden" name="action" value="reset" />
    </p>
    </form>


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:11 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com