Codex tools: Log in / create account
If your plugin or theme needs to handle a POST or AJAX request, direct the request to admin-post.php or admin-ajax.php, respectively. Each accepts an "action" argument. In this argument, provide a string that uniquely identifies your action. admin-post.php will issue an action event called "admin_post_$action", where $action is the string provided in the action argument. admin-ajax.php will issue an "wp_ajax_$action" event. In your plugin or theme, associate a handler for your action using add_action().
This page is marked as incomplete. You can help Codex by expanding it.