Not sure the best way to save custom plugin data

Doing my first plugin with 3.1 Everything is great, but I need to store the data now. My data is sufficiently complex that it requires custom tables (as opposed to options). So now I am wondering how I save the data. Normally, I would just create a processing page to handle it, but that doesn’t seem like the best way within the WP API. How do I go about saving my form data from my plugin settings page into my custom tables? Thanks!

EDIT: To clarify, I know how to code it, I am not sure architecturally the best way to do it.

1 Answer
1

Not that there is specialized API for something exactly like that.

  1. Create your table, see Creating Tables with Plugins in Codex.

  2. Process submitted form (since you are not using higher APIs, don’t forget to check for capabilities, use nonces and such).

  3. Write data to your custom table, using $wpdb.

Leave a Comment