I have been trying to integrate a custom WordPress plugin called custom_rss
into WordPress by following http://net.tutsplus.com/tutorials/wordpress/creating-a-custom-wordpress-plugin-from-scratch/
.
I have successfully achieved the proper URL in the menu items for settings
. However, when I click on the custom_rss
link under settings, the url that loads the plugin just returns content with the text You do not have sufficient permissions to access this page.
. I am logged in as the super user admin.
The script that fires when the menu item is clicked is wordpress/wp-admin/options-general.php
which passes page as its parameter :options-general.php?page=CustomRSSGenerator
.
Does anyone have any ideas about how to allow privileges for this page or better yet, has anyone found out how to do a custom plugin for WordPress 3.5.2 who can offer a solution to my problem? This has been beating me for about a week now and any advice is appreciated.
So there is a solution!
If you read the comments below the tutorial you will find a comment by a Robert character which states:
Posting on this old topic because it was the most relevant Google result when I was searching after running into a similar problem so I figured I’d add my fix.
I had a really similar problem where any change I made to the page slug resulted in an insufficient permission error. At first I thought my page slug must be getting referenced somewhere else in my code so I searched and found no other references. I also tried stripping away every line of code outside of the basic plugin instantiation code but it still didn’t work.
The fix was to deactivate then reactivate the plugin (within admin UI). I’m guessing upon plugin activation wordpress adds various entries to it’s DB; some of which are likely your plugins name, menu page names, slugs, etc. After reactivating the plugin, the exact code that previously threw permission errors now worked perfectly.