• Wow, I’ve been running into all sorts of problems this week. And it’s always dumb crap I shoulda noticed. Bad week I guess. But I’m still being dumb, so I’ll ask for help again.

    I would like to clean up my functions.php…so I’m trying to move my admin options stuff from functions.php to it’s own file. When I do, it breaks. The admin menu works great and all options save….. but if I offload it to its own file, and bring it in like this:

    require_once ( get_stylesheet_directory() . '/admin-options.php' );

    The admin menu loads and works, until I try to save. Then I get the ‘You do not have sufficient priviledges’ error

    Any idea what I should change to be able to offload this to its own file?

    Here’s the actual admin menu code:
    http://wordpress.pastebin.com/JfHenY4w

    I’m not sure if it’s the require once bit I load it in with, or maybe the lines down after 316 where it looks to be saving?

    Thanks once again for helping me understand the stuff I piece together!

Viewing 3 replies - 16 through 18 (of 18 total)
  • Thread Starter Rev. Voodoo

    (@rvoodoo)

    ooh, thanks for whatever you fix on my theme! I’m sure it’s a mess….I piece things together as I find/half understand it!

    I slowly clean things up as I learn….so any help you give is soooooooo appreciated!!!

    Been putting most of my attention on getting your options all working using a single option field (ie. one row in the options table), and filtering each option correctly (eg. esc_url for options that expect URLs, wp_kses for text only, and so on..), couldn’t leave you using 40 seperate options, that would be criminal.. 🙂

    Replaced various functions for upto date counter-parts, for example get_setting is deprecated, so switched calls over to get_option, likewise for calls to get_links, and various other functions dotted around the theme files..

    Have no idea how any of these changes will work out for you, so i’m going to rename the theme and the functions, so you can install it as a secondary theme and test it (don’t overwrite your existing one, keep that as a backup incase something doesn’t quite work right).

    Just want to minimize the possible problems before giving you anything… so watch this space… 😉

    Thread Starter Rev. Voodoo

    (@rvoodoo)

    So very much appreciated. I’m sure I’ll learn a fair bit once you are done and I read through it. Everything is so pieced together from all over the webs…. I’m just starting to learn what everything does… 😉

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘Insufficient priveledges on Admin Options when loaded from another file?’ is closed to new replies.