WP_User_Query
is a user search. This sentence…
But I need to echo only those users name whose meta_key= something but
meta _value is equal to current user ID.
… suggests that that is not really what you want. I think you can accomplish this with:
$current_user = wp_get_current_user();
$meta = get_user_meta($current_user->ID, 'Something', true);
if (!empty($meta)) {
// your current user has the "Something" meta key set
}
Since you are restricting the query to the current user ID I don’t see why you’d need to query, unless this is some kind of cross linking system. If if is you can put the current user ID into the query just like about.
$current_user = wp_get_current_user();
$args=array(
'meta_key' => 'Something',
'meta_value' => $current_user->ID,//here goes current used ID by default.
'meta_compare' => '=',
);
http://codex.wordpress.org/Function_Reference/wp_get_current_user
http://codex.wordpress.org/Function_Reference/get_user_meta