1

I'm a beginner plugin developer. I need my plugin to save and edit multiple indexed sets of key/value pairs on my custom settings page and retrieve later them by their index on the Appearance>>Widgets page.

Is it best to create a custom table in the database for this or does the Settings API have dimensional accommodation for this? If so can someone please get me pointed in the right direction?

TIA

1

Because you mentioned the Settings API I assume you want to do AJAX from the admin area of wordpress. You have some research to do, so my answer is to check out these:

http://dobsondev.com/2015/06/12/wordpress-ajax-example/

https://pippinsplugins.com/custom-database-api-reasons-for-custom-tables-and-an-api/

That should get you where you need to go. Happy Wordpressing!

| improve this answer | |
  • Looks like Pippin's gotta eat too. Now he wants paid for the info :-/ – N Barns May 15 '17 at 15:31
1

The short answer is to go ahead and expand the existing wordpress database. That is because the Settings API really only goes one dimensional and would be a very inefficient use of the database. https://pippinsplugins.com/custom-database-api-reasons-for-custom-tables-and-an-api/

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.