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?
1 Answer
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?– urok93Commented Aug 20, 2012 at 13:18
-
-
2meta 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. Commented Aug 20, 2012 at 16:03