wordpress theme options error - You do not have sufficient permissions to access this page
If you're developing an Admin interface for your Wordpress Theme or Plugin, and you get this error:
You do not have sufficient permissions to access this page
It has always been my experience that this error is thrown because the paths in your theme or plugin's URLs are off. Maybe you are hacking someone's plugin and you've renamed the plugin directory so as to avoid any confusion between your modified plugin and the original. Perhaps the original developer's plugin code has hardcoded the plugin directory name/path, and thus your directory name differs. Often the code is trying to access a page in a directory that does not exist, eg:
/wp-admin?page=old-plugin-name/options.php
If you've renamed the original plugin, this will cause that awesome error, and you'll see a page with nothing except the error. I usually end up tracking down all the hardcoded references using Aquamac's awesome "rgrep" feature, or just grep from terminal. Trying to think of a reason why it would be bad to use a constant or variable like:
$plugin_directory = array_shift( explode( "/" , plugin_basename(__FILE__) ) );













