WP_User_Query search with multiple search queries

Is it possible to perform a WP_User_Query with multiple search queries? Something like:

$args = array (
    'search'    => '*example.com OR *abc.com',
    'search_columns' => array( 'user_email' )
);

or

$args = array (
    'search' => array(
        'relation' => 'OR',
            array(
                'search_columns'    => 'user_email',
                'search'            => '*example.com',
            ),
            array(
                'search_columns'    => 'user_email',
                'search'            => '*abc.com',
            )
        )
    );

then perform query:

    $user_query = new WP_User_Query( $args );

which would return users who’s email domain are @example.com OR @abc.com.

0

Leave a Comment