Possible Duplicate:
How to Rewrite Wordpress URL for a Plugin
I'm creating a plugin for Wordpress. Is there any way or API to make plugin receive a path or URL so that it can trigger or output something. I mean something like this
add_filter('THE_FILTER_NAME', 'myPluginFunc');
function myPluginFunc($url)
{
if($url != 'mydesiredurl')
return;
echo "this URL path is handled by myplugin";
}
or
register_urlpath('mydesiredpath', 'mycallbackfunction');
and also, if applicable, this url path is registered to my plugin so users cannot assign any page using that url anymore, unless myplugin is deactivated.
EDIT: additional info
i'm creating plugin which need a path to be called as something like webservice, when the site is calling is a way, thedomain.com/myplugin, then what i want is the wordpress system understand that the URL requested is for myplugin, and therefore will execute a function myplugin supplied, which in my case, is simply send email to site admin.
Thanks in advance.