get_users

The timeline below displays how wordpress function get_users has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Retrieves list of users matching criteria.
 *
 * @since 3.1.0
 *
 * @see WP_User_Query
 *
 * @param array $args Optional. Arguments to retrieve users. See WP_User_Query::prepare_query()
 *                    for more information on accepted arguments.
 * @return array List of users.
 */
function get_users($args = array())
{
    $args = wp_parse_args($args);
    $args['count_total'] = false;
    $user_search = new WP_User_Query($args);
    return (array) $user_search->get_results();
}

WordPress Version: 5.8

/**
 * Retrieve list of users matching criteria.
 *
 * @since 3.1.0
 *
 * @see WP_User_Query
 *
 * @param array $args Optional. Arguments to retrieve users. See WP_User_Query::prepare_query()
 *                    for more information on accepted arguments.
 * @return array List of users.
 */
function get_users($args = array())
{
    $args = wp_parse_args($args);
    $args['count_total'] = false;
    $user_search = new WP_User_Query($args);
    return (array) $user_search->get_results();
}

WordPress Version: 4.6

/**
 * Retrieve list of users matching criteria.
 *
 * @since 3.1.0
 *
 * @see WP_User_Query
 *
 * @param array $args Optional. Arguments to retrieve users. See WP_User_Query::prepare_query().
 *                    for more information on accepted arguments.
 * @return array List of users.
 */
function get_users($args = array())
{
    $args = wp_parse_args($args);
    $args['count_total'] = false;
    $user_search = new WP_User_Query($args);
    return (array) $user_search->get_results();
}

WordPress Version: 4.1

/**
 * Retrieve list of users matching criteria.
 *
 * @since 3.1.0
 *
 * @see WP_User_Query
 *
 * @param array $args Optional. Arguments to retrieve users. See {@see WP_User_Query::prepare_query()}
 *                    for more information on accepted arguments.
 * @return array List of users.
 */
function get_users($args = array())
{
    $args = wp_parse_args($args);
    $args['count_total'] = false;
    $user_search = new WP_User_Query($args);
    return (array) $user_search->get_results();
}

WordPress Version: 3.9

/**
 * Retrieve list of users matching criteria.
 *
 * @since 3.1.0
 *
 * @uses WP_User_Query See for default arguments and information.
 *
 * @param array $args Optional. Array of arguments.
 * @return array List of users.
 */
function get_users($args = array())
{
    $args = wp_parse_args($args);
    $args['count_total'] = false;
    $user_search = new WP_User_Query($args);
    return (array) $user_search->get_results();
}

WordPress Version: 3.7

/**
 * Retrieve list of users matching criteria.
 *
 * @since 3.1.0
 * @uses $wpdb
 * @uses WP_User_Query See for default arguments and information.
 *
 * @param array $args Optional.
 * @return array List of users.
 */
function get_users($args = array())
{
    $args = wp_parse_args($args);
    $args['count_total'] = false;
    $user_search = new WP_User_Query($args);
    return (array) $user_search->get_results();
}