I have seen and been using the following technique for adding php scripts to my plugin for handling custom forms in a wordpress plugin.
from the quizzin plugin:
$code_pages = array('quiz_form.php','quiz_action.php', 'question_form.php', 'question.php');
foreach($code_pages as $code_page) {
$hookname = get_plugin_page_hookname("quizzin/$code_page", '' );
$_registered_pages[$hookname] = true;
For example, the ‘quiz_action.php’ is later used as the target for an administration form (these forms are used only in wp-admin)
<form name="post" action="<?php echo $GLOBALS['my_plugin_folder'] ?>/quiz_action.php" method="post" id="post">
UPDATE: This method is discussed here – Admin config screen without menu
The final comment below by a WordPress core dev seems to discourage this:
http://wordpress.org/support/topic/how-can-i-execute-php-scripts-in-my-plugin-folder
So what is best practice here? Should administration forms be posting to wp-admin/admin.php?action=foo or wp-admin/edit.php?action=bar. How does one register these actions? Is this documented anywhere? To be clear, these files should not be linked from an admin menu.
I’m using WordPress 3.0.4
Thanks!