There are 2 pretty undocumented hooks 'manage_users_custom_column'
and 'manage_users_columns'
that you can use for the scope.
They works in same manner of 'manage_posts_custom_column'
and 'manage_posts_columns'
that are better documented, see Codex.
So you can do something like this:
/*
* Add Event Column
*/
function users_events_column( $cols ) {
$cols['user_events'] = 'Events';
return $cols;
}
/*
* Print Event Column Value
*/
function user_events_column_value( $value, $column_name, $id ) {
if( $column_name == 'user_events' ) {
global $wpdb;
$count = (int) $wpdb->get_var( $wpdb->prepare(
"SELECT COUNT(ID) FROM $wpdb->posts WHERE
post_type="events" AND post_status="publish" AND post_author = %d",
$id
) );
return $count;
}
}
add_filter( 'manage_users_custom_column', 'user_events_column_value', 10, 3 );
add_filter( 'manage_users_columns', 'users_events_column' );
only be sure to use the correct post type slug in the SQL query inside user_events_column_value
funcion