• I’ve used Advanced Custom Field and added the following category in my User Profile.

    ——————————————————–
    ACF: team
    Values: checkboxes of “development”, “planning”, “design”
    ——————————————————–

    I would like to get_users with these keys.
    For example, get_users for “development” team.

    $args = array(
         'meta_query' => array(
              array(
                'meta_key' => 'team',
                'meta_value' > array('development'),
                'meta_compare' => 'IN',
              )
           )
    );
    $users = get_users($args);

    Unfortunately , this returns ALL users instead of those from the development team as stated in meta_query.
    meta_compare => ‘LIKE’ or meta_compare => ‘=’ doesnt work either.

    I tried to var_dump($users) and i found these are not retrieved through get_users.

    I cant use get_user_meta as i want a list of users, and not the meta information for certain user.

    Is there any way i can do this?

  • The topic ‘Get users with certain meta keys (meta_query)’ is closed to new replies.