2013-01-24, 21:08:09
I'm trying to define plugin wide settings and I'd like to add the setting to the... Settings tab.
Fine: there is the settings-sidebar add-action.
But: the entry in the settings sidebar, then, points to the pages tab.
By reading the the I18N Special Pages's code I've found a workaround:
But, hey, shouldn't automatically an entry in one of the sidebars point to the tab where it shows up?
I don't see a user case where it should not be that way...
I can try to write and propose a patch, if there is an agreement about this being a useful feature.
Ciao
a.l.e
Fine: there is the settings-sidebar add-action.
But: the entry in the settings sidebar, then, points to the pages tab.
By reading the the I18N Special Pages's code I've found a workaround:
PHP Code:
// hack to get the link from the settings sidebar to go to the settings tab
$lists_admin_tab = 'pages';
if (basename($_SERVER['PHP_SELF']) == 'load.php' && @$_GET['id'] == $lists_plugin_id) {
if (array_key_exists('lists_settings', $_REQUEST)) {
$lists_admin_tab = 'settings';
}
}
# register plugin
register_plugin(
...
$lists_admin_tab, //page type - on which admin tab to display
...
);
But, hey, shouldn't automatically an entry in one of the sidebars point to the tab where it shows up?
I don't see a user case where it should not be that way...
I can try to write and propose a patch, if there is an agreement about this being a useful feature.
Ciao
a.l.e