Get meta_query value by user meta array

This should be better for what you’re looking for, the only issue might be how the meta gets returned, as an actual array, or as a string that needs to be turned into an array.

$args = array(
     'post_type' => 'pictures',
     'orderby' => 'post_modified',
     'order' => 'DESC'
     // post_status is unnecessary because default is 'publish'
);

$following_users = get_user_meta($user->ID, 'following_users', true);

if ( !empty( $following_users ) ) {

    $meta_query = array();

    foreach ( $following_users as $following_user ) {

        $meta_query[] = array(
                        'key' => 'picture_liked_users',
                        'value' => $following_user,
                        'compare' => 'LIKE'
                    );

    }

    // If our count is 2+, we need to set our relation
    if ( count( $meta_query ) > 1 ) {
        $meta_query['relation'] = 'OR';
    }

    // Only set our meta_query if there is anything to set
    if ( !empty( $meta_query ) ) {
        $args['meta_query'] = $meta_query;
    }

}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)