I'm developing a new shopping cart plugin for WordPress. At a point, how to save orders, I am stuck, sort of confused. Actually I am not sure whether I should save order through options api or create a new post type to handle Orders. Which approach is the best?? This plugin is not too complicated, it just handles book's shop, so the parameters/options for product are limited.

thanks @Nilambar for your suggestion, if that is the case I have few more questions:

How to prevent admin to create new orders manually( disabling 'add new oreder' )?

And one more thing - Order's post doesn't need title and editor, it will have its own options like order value, order no. etc. but if I don't specify title or editor param in supports array, it shows both by default on order post screen (on new and edit both screens).

What I am experiencing is I have to provide at least one title or editor in supports arrray to disable another otherwise it doesn't work. I want to disable both.

  • I would recommend using Post Type for order. Afterwards it will be easy to add extra information to Order. – Nilambar Sharma Nov 17 '14 at 6:12

You can pass boolean false to supports to have post type support nothing at all.

However note that:

  • you might run into issues with saving "empty" posts (not having one of title/editor/excerpt)
  • likely you still want it to support custom-fields at least, rather than nothing at all
| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.