I'm working on plugin and created Top level admin menu with Settings sub menu.The Setting page has multiple tabs, [base options] [report options] etc. When I render the page for the first time, regardless of what tab is chosen the page is drawn without issues. But when selecting another tab, I get the Sorry, you are not allowed to access this page. There is not error in the debug log. I'm using the WordPress boilerplate as my base. I am the Administrator for the site, so this should not be permission related. The only thing I can think of is that it is related to url that gets created when tab is switch happens.

On the first active tab the url looks like this: http://localhost/multisite/site-one/wp-admin/admin.php?page=onsite-settings after tab switch the url looks like this: http://localhost/multisite/site-one/wp-admin/admin.php?page=onsite_settings&tab=reports_tab

What I tried so far:

  • have 2 render functions for each tab
  • combine the render into one function for both tabs
  • change which tab becomes the default tab when the settings page is activated. Both tabs seem to display the options just fine.
  • Changed where the sub menu page is created. tried in the admin class and settings class. the result is the same.

Any suggestions what to look at next?

  • Try using a relative url or add the code you are using to generate the tabs to your question. May 7 at 23:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.