How to add fields to CPT form without metabox
-
When creating a plugin with a dashboard admin menu and page, we can create a template to display the form for options entry, and on save, all options are saved to wp_options. I’d like to do the same in a CPT, and have complete control over the CPT post entry form. On save_post, all entries would be saved as post meta.
But it looks like the template/form for a CPT is limited to the WP_Post default, with default locations for default fields, and with metaboxes required to contain all custom fields. I don’t want the “boxy” look of metaboxes everywhere, though I do use them as required.
I’m hoping to be referred to documentation and/or code examples where default fields are disabled (register_post_type ‘supports’=>[‘custom-fields’]), and the Add New CptType page is completely subject to our own structures and styling.
Think of common data objects like customer, order, inventory item, vehicle, event, whatever – where a big title and content editor control aren’t relevant. Or again, look at any admin page in the dashboard.
I do not want to use ACF or other plugins. I’m writing plugins and do not want dependencies.
Sincere thanks!
- The topic ‘How to add fields to CPT form without metabox’ is closed to new replies.