How do I add a settings page on a MultiSite without destroying the dashboard?
-
Hi all
So I’ve been writing simple plugins for a while and creating settings pages for them for a while also. Then I installed a multisite and my plugins worked perfectly… but my dashboards do not. In fact, my dashboard(s) get entirely nuked… ??
Please have a look at the code below:
include_once(plugins_url('settings.php', __FILE__)); include_once('settings.php');
If I use the first method then I am able to use Network Enable but I am not able to enable it on individual websites. On the flip side of the coin, if I use the latter method then I can install the plugin on individual websites but I can’t use Network Enable.
In both cases the plugin is enabled just fine and if I go to the site the plugin is functioning perfectly but when I try to go back to my dashboard all I see is an error about an unrecognised user and that is that… my entire dashboard is replaced by a white screen with a single error message on it. I have absolute 0 access to any part of my dashboard unless I open up either the individual website or the network dashboard, respectively, depending on which one I enabled the plugin on.
So, if I use network enable I can then open the dashboards of each individual site but have no access to the settings of the plugin nor the option to disable it. Alternatively, if I enable it on an individual website in my multisite then I no longer have access to the site’s dashboard AT ALL(!) but I can still get to the main dashboard, which doesn’t help me at all with getting into my subsite’s plugins section…
Once I click on the enable button (or network enable) the plugin functions as it should on the site(s) but if I want to get access to my dashboard again I need to ftp into my site and rename the plugin folder or delete it completely.
So my question to you is simply this: How do I properly include a settings file when I create a plugin for a multisite website?
Thanks for any support in this regard. Currently all my plugins have a “Supports multisite, just don’t use Network Enable” label slapped on top of it ??
For a sample of my code, see here: Asset Store affiliate link generator
- The topic ‘How do I add a settings page on a MultiSite without destroying the dashboard?’ is closed to new replies.