Creating a plugin that will add options. Where should the options menu pages go?

I am creating a plugin for a restaurant theme that will provide a few options to add the restaurant hours of operation. Currently, I use a custom post type to control the restaurant hours but have since realized this is a bad practice because if the theme changes that info will be lost. I would like to separate them via a plugin and uses options instead of a custom post type.

Is there a standard practice for where the options menu pages should be placed? Theme customizer page? Plugin settings? Custom page? New page under the Settings section?

Update

Planning to use the existing wordpress APIs so I am not worried about the storage of the data.

3 Answers
3

I am reading your question as being “Is there a standard practice for where the options menu page should be placed?”

Is there a standard practice for where the options should be placed?

I don’t think so but there are better and worse places.

Theme customizer page?

No. This is bad for the same reason you are worried about your current setup. It is connected to a particular theme, and wouldn’t easily transfer to a new one.

Plugin settings?

This could work, but the settings would be somewhat hidden. Getting to plugin settings pages is not especially straightforward.

Custom page?

You mean a new top-level menu– Next to to “Posts”, “Pages”, “Links”, that kind of thing? This could work too but I’d shy away from it unless you have a number of different configuration pages to add beneath the main menu. It is very easy to create a lot of clutter on the sidebar.

New page under the Settings section?

This seems like the best place to me to add a single menu. Logically, what you are creating fits well under “Settings” and it would be out of the way most of the time. And it is not associated with a particular theme.

It isn’t clear where you are planning to save the options in the database, but I assume you’ll be using the Options API to store the data in the *_options table. The Settings API is worth looking into to help with the form building/managing.

Leave a Comment