I've read too many times this kind of code to add a link in plugin admin page:
<?php
function plugin_add_settings_link( $links ) {
$settings_link = '<a href="options-general.php?page=plugin_name">' . __( 'Settings' ) . '</a>';
array_push( $links, $settings_link );
return $links;
}
$plugin = plugin_basename( __FILE__ );
add_filter( "plugin_action_links_$plugin", 'plugin_add_settings_link' );
?>
What this piece of code doesn't answer is my question: how to have the link do what I want it to do.
options-general.php?...
or whatever doesn't tell me how from a single link I can trigger a single function in my plugin.
if in my plugin file I have
function my_plugin_function() { ... }
I want the user to be able to click a link <a href="???">Click here</a>
so my_plugin_function
get fired.
How to do so?
Is there some url formatting which does this trick (something wich may looks like this "plugin-call.php?action=my_plugin_function&nonce=d56f654a465e4¬arealworldexample=donttellmeaboutit
")?
EDIT:
Apparently I have to start a bounty to have this question answered.
The question being "How from the admin panel can I have a link trigger a function from my plugin (with an (async)postback ?)?" I think it deserves 5 billions points.
I don't have those and a mere 50 points for such a complex question would feel like a joke.
So here it is "IOU 5.000.000.000 points". The one who answer the question can have it.