|
I’m a little confused as to best practise for saving multi-select values in meta fields. Assuming
is my form field if I store $_POST[‘_casestudypost’] in a meta_key of the same name? (which returns an array) – how can I find out when 281 is in that array. I’ve tried:
However the generated SQL that WordPress generates under the hood seems to ask, is meta_value (13,281,45) in 281, rather than is 281 in meta_value (13,281,45). |
||||
|
Answers
|
An
is going to be the same as
If you are going to be pulling by values, or key/value pairs, store each of your selected If you don’t have to search by the value, then save the serialized array. There is not enough context to your question for me to tell whether you really need to be searching by the value or not. There may be ways to get the result you want that you aren’t thinking about. |
||||
|
|
The default
|
||
|