I see some discrepancy in plugins' tabs & menus:
Except that no action in $_GET is ever created. Rather $_GET gets an empty my-action key. That given, proper code to handle multiple actions would be something along these lines:
Unless this is a bug that needs to be patched, am I free to go ahead and correct it?
Quote: (3.1+) If you want to add multiple links for your plugin, you can use the optional parameter action:This way a new parameter action=my-action is added to the link and you can determine which link was clicked.PHP Code:add_action('xxxxxx-sidebar','createSideMenu',array('your-plugin-filename','Menu Text', 'my-action'));
(...)
main function (here hello_world_show) would look like this:
PHP Code:function hello_world_show() {
if (@$_GET['action'] == 'setup') {
...
} else if (@$_GET['action'] == 'show') {
...
}
}
Except that no action in $_GET is ever created. Rather $_GET gets an empty my-action key. That given, proper code to handle multiple actions would be something along these lines:
PHP Code:
function hello_world_show()
{
if( array_key_exists( 'show', $_GET ) ) {
...
}
elseif( array_key_exists( 'setup', $_GET ) ) {
...
}
elseif( array_key_exists( 'my-action', $_GET ) ) {
...
}
else {
...
}
}
Unless this is a bug that needs to be patched, am I free to go ahead and correct it?