500

professional dilettante

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 [...]

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__) ) );

Leave a Reply

Required fields are marked with an asterisk (*), you may use these tags in your comment: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Spam protection by WP Captcha-Free

Most Recent Post

posting data with curl from the command line

Before i forget, an easy way to test if you can connect to an external api is to use CURL on the command line. This nice as a sanity check/proof of concept to ensure you have the right token, proper field mappings, submitting the right data. This saves you from setting up a test form, [...]

Categories

Content © professional dilettante
Proudly powered by WordPress
Theme designed by Artisan Themes

Entries (RSS)
Comments (RSS)

22 queries.
0.582 seconds.