I am trying to run a meta_query meta_value with an array of values and have it search if all are present in the meta value which is stored in a serialized array. Is this possible?
I want to get a query meta_value = array( post_id => 21583, select => 1 ) but stored in serialized array
a:3:{i:0;s:0:"";i:21583;a:3:{s:7:"post_id";s:5:"21583";s:6:"select";i:1;s:4:"date";s:19:"2020-12-22 09:01:39";}i:21120;a:3:{s:7:"post_id";s:5:"21120";s:6:"select";i:3;s:4:"date";s:19:"2020-12-22 09:02:02";}}
I want this serialized array value "post_id";s:5:"21583";s:6:"select";i:1;
Eg :
$args = array(
'post_type' => 'post',
'posts_per_page' => '9',
'meta_query' => array(
array(
'key' => 'users',
'value' => array(post_id => 21583, select => 1),
'compare' => '='
)
)
);
Aucun commentaire:
Enregistrer un commentaire