Skip to main content
1 of 2
Trello
  • 111
  • 3
  • 13

Get meta_query value by array meta

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 example of how following_users meta is store in the database:

a:1:{i:0;s:2:"87";}

So i try to get the user meta following_user by using array but i failed it's give me a PHP error and also try extract PHP function but also failed.

Any help?

Trello
  • 111
  • 3
  • 13