I need to get the author information, who having maximum number of post(custom post type).
Here is the code I tried to get the result.
$author_query = new WP_User_Query(array (
'orderby' => 'post_count',
'order' => 'DESC',
));
$authors = $author_query->get_results();
foreach ( $authors as $author ) {
echo $author->ID;
echo $author->display_name;
}
The result is getting as post-count of normal posts. Here I have custom post type instead of default post. I need to get the result based on my custom post type’s post count..