I'm fairly new to WP development so please excuse me if my question does not make any sense.
I'm trying to develop a plugin and have it (so far) set up and working. I have already registered some options which all work too and get nicely stored as array in the
Now I have read in the WP Developer Handbook that there are 4 methods of saving data and the preferred method would be through Post Meta.
So far so good, but what would I have to do now? Do I need to set up a custom post type first and then add custom fields to it? Would that count as post meta? Guess not, at least I would not know how WP knows that it should put data in the
Maybe I also should explain what exactely I want to do. My plugin is supposed to be some sort of booking plugin which (for now) should do the following:
- on the frontend the user should be able to set the arrival date, name & address and some booking item.
- on the backend the admin should see a list of bookings and should be able to manage some plugin options.
Which pretty much means there is no need for a CPT Area in the admin panel - I want to control that within the plugin view.
Again, I'm sorry if my qeustion is stupid but I'm really confused with the ton of options you are able to set.
Any help appreciated!
According to @kero's comments, I want to reformulate my answer:
According to the WP Developers Guide the
wp_options table is not suitable for a lot of data. It's supposed to be fairly static content and settings. This means I cant use the Settings API to populate data from my booking plugin.
Furthermore, the guide says that Custom Post Types cover pretty much everything else you need, so this is the road I wanna go down.
What confuses me now is the way how this CPT works! I don't need most of the options of a standard PT and what I really don't understand is how I can add custom fields (or post meta when we are not talking about the admin section)! All I can find online is people using ACF or some other plugin to add those fields. How can I do that manually and would I need to change the
capability_type as well?
I would also be happy wit a nice tutorial but so far I did not find anything where people are registering a CPT and manually add CF's.