Custom post type Vs. data in own table

I’m trying to get started with WP development. So far I’ve been using it with other’s people plugins and themes so I’m kind’a stuck.

I’ve read many many many things about, but I can’t find simple answer when to use what.

Read More

e.g. I’d like to create order page (webshop without payments, just simple order that resides on system and administrator then have a chance to check, confirm, set status to that order to “products sent” and so on).

So now, I should have – users, articles (distributed in some categories, with some brand tags) and orders and my plan was to create wp_MyArticles table, with menu in wp dashboard, where admin could do certain things with it.

But then, 50% of people told me NOT TO mess with WP database, and create my own table, but to rather use custom post types, with custom fields.

I’ve read again tons of blogs / pages but still, I’m not sure, what do I get with custom “post” (Article), when I need to list it, select few of articles, add them to orders. Where to put orders ? How to create subpages that will deal with orders, with articles ?

And most important, I’m trying to find how to code my own plugin for members area, so that even as administrator I avoid dashboard, and work only on “my backend” part?

My idea is not to buy / use some ready made plugin, but to learn how to do it on my own, but it seams I can’t google right things, all blogs and how to’s are copies of copies of copies of same examples and are using same plugins.

So, any how to / why / what to read is needed and appreciated.

Related posts

Leave a Reply

1 comment

  1. Unless you need complex many-to-many relationships, you should stick with the built in tables where you can.

    In your comment above in reply to Toscho, you essentially describe a custom post type with attachments (images), meta-data, and a taxonomy (tags). All of this would be a snap to accomplish using the provided API, so I don’t see what could be gained in that particular example by using your own tables.

    If you ultimately do want to define your own tables, I suggest storing comma-separated values instead as individual rows in a separate table and doing JOINs, querying on that data would otherwise not be so easy.