To use the LIKE
comparison, try a string:
$args = array(
'post_type' => 'post',
'post_status' => 'publish',
'meta_query' => array(
array(
'key' => $user_key,
'value' => 'followed', // String here
'compare' => 'LIKE',
),
),
);
return get_posts($args);
Also, you can use WP_Query
to help you debug:
$args = array(
'post_type' => 'post',
'post_status' => 'publish',
'meta_query' => array(
array(
'key' => $user_key,
'value' => 'followed', // String here
'compare' => 'LIKE',
),
),
);
$query = new WP_Query( $args );
echo '<xmp>';
print_r( $query->result );
die;
$query->result
should contain the generated SQL, and will show you how WordPress is preparing your meta data.