wp-includes/author-template.php:454Lists all the authors of the site, with several options available.
$argsstring|arrayoptional''$orderbystringdefault: 'name'
$orderstringdefault: 'ASC'
$numberintdefault: empty (all authors)
$optioncountbooldefault: false
$exclude_adminbooldefault: true
$show_fullnamebooldefault: false
$hide_emptybooldefault: true
$feedstringdefault: empty
$feed_imagestringdefault: empty
$feed_typestringdefault: is the value of get_default_feed()
$echobooldefault: true
$stylestring
$htmlbooldefault: true
$excludeint[]|stringdefault: empty
$includeint[]|stringdefault: empty
void|string2 hooks fire while wp_list_authors() runs, in this order:
Filters the query arguments for the list of all authors of the site.
Filters whether to short-circuit performing the query for author post counts.
function wp_list_authors( $args = '' ) { global $wpdb; $defaults = array( 'orderby' => 'name', 'order' => 'ASC', 'number' => '', 'optioncount' => false, 'exclude_admin' => true, 'show_fullname' => false, 'hide_empty' => true, 'feed' => '', 'feed_image' => '', 'feed_type' => '', 'echo' => true, 'style' => 'list', 'html' => true, 'exclude' => '', 'include' => '', ); $parsed_args = wp_parse_args( $args, $defaults ); $return = ''; $query_args = wp_array_slice_assoc( $parsed_args, array( 'orderby', 'order', 'number', 'exclude', 'include' ) ); $query_args['fields'] = 'ids'; /** * Filters the query arguments for the list of all authors of the site. * * @since 6.1.0 * * @param array $query_args The query arguments for get_users(). * @param array $parsed_args The arguments passed to wp_list_authors() combined with the defaults. */ $query_args = apply_filters( 'wp_list_authors_args', $query_args, $parsed_args ); $authors = get_users( $query_args ); /** * Filters whether to short-circuit performing the query for author post counts. * * @since 6.1.0 * * @param int[]|false $post_counts Array of post counts, keyed by author ID. * @param array $parsed_args The arguments passed to wp_list_authors() combined with the defaults. */ $post_counts = apply_filters( 'pre_wp_list_authors_post_counts_query', false, $parsed_args ); if ( ! is_array( $post_counts ) ) { $post_counts = array(); $post_counts_query = $wpdb->get_results( "SELECT DISTINCT post_author, COUNT(ID) AS count FROM $wpdb->posts WHERE " . get_private_posts_cap_sql( 'post' ) . ' GROUP BY post_author' ); foreach ( (array) $post_counts_query as $row ) { $post_counts[ $row->post_author ] = $row->count; } } foreach ( $authors as $author_id ) { $posts = $post_counts[ $author_id ] ?? 0; if ( ! $posts && $parsed_args['hide_empty'] ) { continue; } $author = get_userdata( $author_id ); if ( $parsed_args['exclude_admin'] && 'admin' === $author->display_name ) { continue; } if ( $parsed_args['show_fullname'] && $author->first_name && $author->last_name ) { $name = sprintf( /* translators: 1: User's first name, 2: Last name. */Introduced in 1.2.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/author-template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.