Support » Fixing WordPress » multiple meta comparisons in get_users()

  • i see in codex that you can put “meta_key”, “meta_value”, and “meta_compare” once but trying to add another comparison in the same query does not work.

    here is a working example of a single meta key comparison…

    $users=get_users(
    array(
    "meta_key" => "profile_status",
    "meta_value" => "private",
    "meta_compare" => "!=",
    "number" => 15,
    "orderby" => "registered",
    "order" => "DESC",
    "fields" => "all_with_meta"
    )
    );

    but i want to have another meta comparison to make sure key “user_avatar” != “nophoto.jpg”….

  • The topic ‘multiple meta comparisons in get_users()’ is closed to new replies.