Number of posts next to user in users.php excluding Custom Post Types

I have noticed that the list of users generated by users.php in my dashboard doesn’t take into account custom post types when it displays the number of posts by each user.

So even if a user has 20 posts of a custom post type, it will still show ‘0’ next to their name.

Read More

Does anyone know how to resolve this and add custom post types to this number?

Related posts

Leave a Reply

1 comment

  1. For anyone else looking to achieve the same, I managed to resolve it using this solution…

    function my_manage_users_columns($columns) {
        $columns['post_type_count'] = __( 'Books', 'textdomain' );
    
        return $columns;
    }
    add_filter('manage_users_columns', 'my_manage_users_columns');
    

    With ‘Books’ being the name of the custom field