0

I would like to store a few extra details for my custom post type, using meta boxes. Should I store all the values under one meta key in an array, or create several meta key and value pairs?

  • Please define your "few extra details". – Chip Bennett Aug 20 '12 at 16:02
1

If you want to use the values to sort or filter the data, you should keep them as separate entries.

  • and if not, I should use an array? Does it improve performance or have any other benefit? – urok93 Aug 20 '12 at 13:18
  • I don't know if it improves performance or not. – nvwd Aug 20 '12 at 13:54
  • 2
    meta data are intended to be discrete key => value pairs. You should store them as such. You gain no performance improvements by trying to force them into an array. – Chip Bennett Aug 20 '12 at 16:03

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.