• 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!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Tony G

    (@starbuck)

    I just hooked edit_form_advanced and that puts echoed text where expected, right before ‘/post-body’. Hooking edit_form_after_editor results in the content being inserted before the metaboxes rather than after. I think I have the answer. I’ll continue to build into this area until someone suggests otherwise. Thanks.

    • This reply was modified 3 years, 1 month ago by Tony G.
    Thread Starter Tony G

    (@starbuck)

    I just read through wp-admin\edit-form-advanced.php. I see the hooks that are called to build a post/page entry page, and I see where they are called so that I can insert CPT-specific content. Unless there is an API built around this like we have for ‘add_menu_page’ or ‘add_meta_box’, I will create one within my code.

    Thanks for patience, and I hope this thread helps someone else.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add fields to CPT form without metabox’ is closed to new replies.