How do you handle multiple forms in WordPress plugin development?

Solution:

Depends on how your plugin is generating the form. Typically you do it by registering a shortcode, something like [my_form] that you can insert into a page or post where you want the form to appear.

In your plugin code the form action can be blank — simply reload the same WordPress page. Your form info. will be in the global $_POST and your plugin can then process the data.

So your plugin shortcode function would have something like:

if(isset($_POST['my_plugin_form_field'])){
 /* code to process the form info and generate a message on screen 
 }

else{
/* the form hasn't been submitted yet so here is the code to display it
}