Custom WP plugin ‘Do not have sufficient permissions’ when accessing options page

If you’re using, for example, this tutorial from NetTuts: http://net.tutsplus.com/tutorials/wordpress/creating-a-custom-wordpress-plugin-from-scratch/

Beware this bit of code:

[sourcecode]
function oscimp_admin_actions() {
add_options_page(“OSCommerce Product Display”, “OSCommerce Product Display”, 1, “OSCommerce Product Display”, “oscimp_admin”);
}
[/sourcecode]

The fourth option in the array is the URI of the page; the spaces are taken out automatically by WordPress, but the case remains, so if you’re using a case-sensitive web server you’ll get permissions errors when trying to access the page.

Change it to something like ‘oscommerce_product_display’ and you should be fine.

 

Leave a Reply

Your email address will not be published. Required fields are marked *