You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One day I noticed that the Aliases settings tab was missing in network site settings. I traced the problem to The Events Calendar PRO plugin. When that plugin was activated, the tab disappeared, and when I deactivated it, the tab re-appeared.
In my understanding, the problem is in the following lines of code:
Interesting find @villeveikkoilen. I have confirmed this behavior as I have a multisite using The Events Calendar and another one without it. The one that has TEC is missing the Aliases tab. I have discovered another issue as well.
Problem: When viewing a custom tab that has been added to a multisite using the network_edit_site_nav_links filter, the Alias tab also disappears.
From what I can see, Mercator is adding the Aliases tab using Javascript.
* Outputs the link, then moves it into place using JS, as there are no hooks to
* speak of.
*/
functionmaybe_output_site_tab() {
At the time this might have been the only way to do it however there is a hook that can be used to avoid using JavaScript. Perhaps something like this to replace maybe_output_site_tab() ...
add_filter( 'network_edit_site_nav_links', 'mercator_add_settings_tab' );
function mercator_add_settings_tab( $tabs ) {
// add a new tab to the Edit Site area for Sites
$tabs['mercator-aliases-nav-link'] = array(
'label' => 'Aliases',
'url' => 'admin.php?action=mercator-aliases',
'cap' => 'manage_sites'
);
return $tabs;
}
Problem
One day I noticed that the
Aliases
settings tab was missing in network site settings. I traced the problem toThe Events Calendar PRO
plugin. When that plugin was activated, the tab disappeared, and when I deactivated it, the tab re-appeared.In my understanding, the problem is in the following lines of code:
Mercator/admin.php
Lines 64 to 66 in 9240e7c
For some reason, I don't know why, when TEC plugin is activated,
$GLOBALS['submenu_file']
value isNULL
, when it should besites.php
.Versions
Possible fix (POC)
There's a proper way of getting current admin screen instead of reading globals. My suggestion would be to replace these lines:
Mercator/admin.php
Lines 64 to 66 in 9240e7c
with:
The text was updated successfully, but these errors were encountered: