This plugin supports only what is possible with WP_User_Query, see the Codex for full info. But it does appear that the has_published_posts parameter may be relevant, and is not included in SUL. I can’t do a full test on it now.
But something like this may help:
[userlist number="5" query_id="product_authors"]
And then manually add the product type support:
function kia_filter_by_cpt( $args, $query_id ) {
if( $query_id == 'product_authors' ) {
$args['has_published_posts'] = array( 'product' );
}
return $args;
}
add_filter( 'sul_user_query_args', 'kia_filter_by_cpt', 10, 2 );
I don’t know if that will work exactly as you need, but it’s hopefully a start. I’ll try to add support for that eventually, but this is one of my free plugins and so I can’t prioritize work on it.
Cheers!
@jtcheng I’ve just added support for has_published_posts in a developmental version of the plugin here: https://github.com/helgatheviking/Simple-User-Listing/tree/feature/loop
Would you check it out and see if it works for you? The shortcode attribute value would be a comma-delimited list of post types.
[userlist has_published_posts="custom-post-type,posts,products"]
Keep in mind you would still need to customize the templates output to show a different count and a different link. but you can use the template attribute to assign a unique template when displaying a directory based on a custom post type.
[userlist has_published_posts="custom-post-type" template="custom-author"]
And then instead of the content-author.php template, the plugin would load content-custom-author.php from your theme’s simple-user-listing/ directory.
Also, remember this is a developmental version and you should test it extensively before using it in production. Please let me know if it works for you!