Find_in_Set
-
Hi,
want to use Find_In_Set to retrieve posts with certain custom field meta values, when the custom field stores an array, and I know one of the values of that array.
ex. $query = new WP_Query(array(‘post_type’=>’my_post_type’,’meta_key’=>’relationships’,’meta_value’=>$relationship_id,’meta_compare’=>’LIKE’));
in this case, a certain row’s relationships field holds ‘298, 2984’ and $relationship_id is 298, so the above query will ‘work’ but will return false results if another row’s relationships holds an array value like 1298 or 22982
Is there a filter I can add to WP_Query? I really dont want to write out the query in MySQL as there are other arguments in the query I left out for readability that make the query more complex.
Thanks!
The topic ‘Find_in_Set’ is closed to new replies.