How to do get_users() with multiple meta_keys

As it mentions in the Codex page for get_users, it works the same as a WP_Query meta_query, see that page for full arguments list and examples.

$args = array(
    'meta_query' => array(
        array(
            'key' => 'some_key',
            'value' => 'foo',
            'compare' => '='
        ),
        array(
            'key' => 'another_key',
            'value' => array( 'bar', 'baz' )
            'compare' => 'IN'
        )
    )
);

Leave a Comment