I have created a plugin, its adds an admin menu page for the menu. The page contains a form.
What I want to know is what is the suggested convention/method of handling form submissions.
- Should I load the page and in that check for the $_POST ?
- Should I load a separate form page ?
Thanks.
DETAILS:
The thought behind is:
I would want to load a new page and have my submit code it in, but would want to follow convention and the login/rules of capabilities.
(moved into wordpress.stackexchange.com)
You can use a form page into your plugin and when you load the page you check the $_POST like this
To load the new page if you have submit you have 2 solutions, in the “action()” you generate another page via PHP or you redirect to the other page you want but you have to register it to WordPress unless you’ll have an access denied.
Personnaly i suggest to generate your page into your plugin.