Whenever you’re working on a plugin that offers a page for its settings, there are several ways that you can save and retrieve the information.
You can:
- use the Settings API,
- use a custom page and calls that are a hybrid of the two,
- use some type of hybrid between a submenu page (or a menu page) and other functionality.
The more I’ve worked with WordPress, the less and less I care to use the Settings API and opt to go with a bit of a hybrid approach.
Depending on the requirements of the project, the implementation will vary; however, I try to use a relatively consistent way to create the functionality.
And though this post won’t go into the various ways that I create my pages, related classes, and so on, it will offer one way that you can go about initializing plugin settings when working on your project or a project for someone else.