This is my code:
$type = "pictures";
$args['orderby'] = "post_modified";
$args['order'] = "DESC";
$args['post_type'] = $type;
$args['post_status'] = "publish";
$args['meta_query'] = array(
array (
'key' => 'picture_liked_users',
'value' => array(get_user_meta($user->ID, 'following_users', true)),
'compare' => 'LIKE'
),
);
I need to get the pictures that liked by users that I follow.
This is an example of how following_users meta is stored in the database:
a:1:{i:0;s:2:"87";}
So I try to get the user meta following_user by using an array but I failed it gives me a PHP error and also try extract PHP function but also failed.
Can anyone help me?