I read this question Should I use custom post types or a custom database tables for plugin development? and the associated accepted answer, both of which I found very helpful.

My question is, given I am doing some complex functions that require models and queries that don't fit neatly into the WP conception of posts, post_meta, and taxonomies, how do I link these data models and populate them from the admin backend?

I know that I need my own logic for storing and sanitizing into the database as a consequence of my wanting to avoid posts, and I'm fine with that, but I'm asking how would I link them as one of the icons/options in the backend, where posts, pages, and other things are?

Do I have to make a register_post_type() and then intercept it? Or is there an option if I make my own data model to somehow embed it and a template/metaboxes as you would do with a custom post in the admin backend?

  • 1
    WordPress will give you very little help with this, in terms of APIs. $wpdb will give you a slightly better way to interact with the database, and WP_List_Table might help with some basic UI, but pretty much everything else you'll need to do yourself. Just in terms of adding somewhere in the admin to start, add_menu_page() can be used to add a page to the the admin sidebar. – Jacob Peattie Jul 18 '18 at 14:40
  • @JacobPeattie thank you! add_menu_page() and the associated callback is what I was looking for I think :) Thanks so much! – Summer Developer Jul 18 '18 at 14:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.