So I've been working on created a catalog based off of wordpress's metabox functionality with a custom post type, but now as it comes time to start searching the database to return specific data sets, I'm realizing that I cannot query the data that has been stored inside a metabox because it is being stored as a serialized array in the database. I have been using Dimas' metabox library (which I much appreciate) to process the metaboxes, but then realized that the data was being serialized.
I can't work with serialized data (at least I don't think I can) because I need to be able to query the database to select data sets according to the values of the metabox data.
My question is if I go with the straight building of the metaboxes, like Justin Tadlock's tutorial over at Smashing show how to do, will that data still be serialized, even if there is only one value per metabox? From everything I'm reading it seems to suggest that such is the case. If so, I'm afraid I'll have to work outside the metabox functionality, which I wouldn't even know how to begin.
So I've been working on created a catalog based off of wordpress's metabox functionality with a custom post type, but now as it comes time to start searching the database to return specific data sets, I'm realizing that I cannot query the data that has been stored inside a metabox because it is being stored as a serialized array in the database. I have been using Dimas' metabox library (which I much appreciate) to process the metaboxes, but then realized that the data was being serialized.
I can't work with serialized data (at least I don't think I can) because I need to be able to query the database to select data sets according to the values of the metabox data.
My question is if I go with the straight building of the metaboxes, like Justin Tadlock's tutorial over at Smashing show how to do, will that data still be serialized, even if there is only one value per metabox? From everything I'm reading it seems to suggest that such is the case. If so, I'm afraid I'll have to work outside the metabox functionality, which I wouldn't even know how to begin.
Share Improve this question asked Aug 6, 2012 at 23:46 BrentBrent 8032 gold badges8 silver badges17 bronze badges 2- Use the RW meta box library instead ;) – kaiser Commented Aug 6, 2012 at 23:51
- Kaiser, That's what I was looking for: deluxeblogtips/2011/03/meta-box-script-update-v30.html – Brent Commented Aug 7, 2012 at 0:57
1 Answer
Reset to default 0As Kaiser suggested, the Metabox script available over at http://www.deluxeblogtips/2011/03/meta-box-script-update-v30.html propagates metadata to the database as individual entries instead of a serialized array. I suppose it is ultimately a matter of preference between how you want your data to be stored in the database. I have appreciated using Dimas'WP Alchemy plugin up until now, but now that I need to be able to query the database according the meta value, I needed to be able to access specific values directly. Rilwis'solution adds the meta data to the database as individual entries (non-serialized) which is what I needed.
Thanks Kaiser.