i have a user_meta for users that them is array like below:
user_saved_posts = [31289,31482,27641]
and i want to get users that their user_meta include an item of an array like below:
goal_posts = [31289,31422,77641,41289,21482,17641]
if user have an item of goal_posts array must returned them. i use below code but this code worked if i have a value for search in user_meta
$args = [
'meta_query' => [
[
[
'key' => 'saved_posts',
'value' => sprintf(':"%s";', 31289),
'compare' => 'LIKE'
]
]
]
];
get_users($args);
unique
parameter to false, and then your code will work. Note that in this way you have 3user_saved_posts
meta instead of a single array. Let me know if you needed any more help.