I’m transitioning from CodeIgniter to WordPress. Still trying to wrap my head around WordPress plugin development… seems pretty easy, but one thing I can’t figure out is: where do I send the form data? In CodeIgniter, you could simply create another method in the controller and point the form action there, but it seems WordPress plugins are a little different.
I’m transitioning from CodeIgniter to WordPress. Still trying to wrap my head around WordPress
Share
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: