I am trying to get a user by
$user = get_users( array ( 'meta_key' => 'token', 'meta_value' => $token, 'orderby' => 'meta_value', 'order' => 'DESC', 'number' => '10', ) );
This returns empty array, but there is a user with that meta key value.
$user = reset( get_users( array( 'meta_key' => 'token', 'meta_value' => $token, 'number' => 1, 'count_total' => false ) ) );
false with a notice:
only variables should be passed by reference in
, but still there is a user with that value for the meta.
I need just to select a user FROM the current blog (to check, is it exists ) by metavalue. User in WordPress NETWORK, which is not attached to the current blog.