get_users
Retrieve list of users matching criteria.
Description
(array) get_users( (array) $args = array() );
Returns (array)
List of users.
Parameters (1)
- 0. $args — Optional. (array) =>
array()
- Arguments to retrieve users. See
WP_User_Query
::prepare_query(…). for more information on accepted arguments.
Usage
if ( !function_exists( 'get_users' ) ) { require_once ABSPATH . WPINC . '/user.php'; } // Optional. Arguments to retrieve users. See WP_User_Query::prepare_query(). // for more information on accepted arguments. $args = array(); // NOTICE! Understand what this does before running. $result = get_users($args);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/user.php
- 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();
- }