Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

author-test

// WP_User_Query arguments
$args = array (
	'role'           => 'Author',
	'orderby'        => 'display_name',
	'meta_query'     => array(
		array(
			'key'       => 'author-name',
			'compare'   => '=',
			'type'      => 'CHAR',
		),
	),
	'count_total'    => true,
	'fields'         => array( 'author_nicename' ),
);

// The User Query
$user_query = new WP_User_Query( $args );