Are you sure? Look at the code of this function (at the bottom of the page). It just retrieves the posts count for the user from the database. I think you misinterpreted your code.
Yes, it relies on get_posts_by_author_sql() function. But look at its code too… 6125 line. It justs adds posts types to the SQL query.
So you either misinterpreted your code (most likely), or your database structure is broken.
Related Posts:
- WP-Admin edit.php & post.php slowdown after import of 10k users
- How to restrict author to only access one custom post type ?
- Display custom post counts for author , not default posts
- Custom post type for ‘staff’ versus using wordpress user profiles?
- Showing User’s Post Counts by Custom Post Type in the Admin’s User List?
- Prevent trash/delete action on specific post types
- Taxonomy count per Post type
- the_author_posts_link() for authors of custom post types
- Count posts or custom post types from last 24 hours (or from today)
- Adding %author% in custom post type URL structure?
- Count post that have specific meta value
- Author archive only for custom post type
- Custom loop for custom post type for current author
- User roles – enable custom posts disable posts
- Allow User to Edit Page Based on their Email
- Show Custom Post Type by Author
- taxonomy list display custom post count
- How to restrict specific post types from being read or added by specific user roles (eg. author)?
- Custom Post Type Category List & Post Count
- Recent comments on author page?
- How can I get the last posts by user role?
- Assigning a role to a specific custom post type (and ignoring other post types)
- WordPress allow access only one custom post type “xyz” to custom user role but need to hide all admin panels
- Get count of custom post type created by current user
- How to show custom post type count in the users admin page
- Get the terms of a custom taxonomy for a specific author in author template
- Delete Current Author Frontend user while delete custom post type
- Total Word Count For Posts And Comments By One Author
- How to fetch custom post by Author?
- Check if author or current user has posts published
- Get Author for Single Post in Custom Post Type
- Link users to a custom post type
- count_many_users_posts except current logged in user?
- How can I show a custom post type for users in the authors.php file?
- WordPress post count not showing for custom post type author
- Custom Post Type and Labels
- right_now_content_table_end function not working?
- How to only show posts assigned to current user, only in certain post types
- Ajax Check Post Status
- Want to Add Custom Fields for Uploading video to WordPress Users from front end
- how to delete all users and posts based on ‘user_meta’?
- get_attached_media() on author page not working
- How to make sure content doesn’t display if selection is empty
- Roles for Custom Post Types
- Hiding posts by other users and non-logged in
- Permit users with author role to edit a custom post type
- URL rewrite add author as base
- Disable user from updating certain posts
- Query posts based on the meta key values of logged-in users?
- How to show featured image block in custom post type for Author?
- Associate multiple users to custom post type
- How can i display movies in profile page, added by an user?
- Custom User role not working with custom post type
- get comments by current user inside page template
- Post loop count is not in order
- Assign post type to many users
- Check if user has comment on current post
- Author comment count in author page
- I am trying to get cutom post cout by month of current taxonmy term
- post body class for current user only if they are the post author
- how to count the current posts terms
- Find custom post type url by author
- Display latest posts of author in a custom post type
- Add a custom post when inserting a new user in WordPress?
- Custom post type title of each author in his own post
- Display author box on just certain category posts?
- Plugin needed to allow subscribers to post articles on the front end without admin approval [closed]
- Use Author Ids or Names to echo different output inside loop
- Creating an option for writing a post without an author attribution for a group blog on WordPress
- Showing only posts from the current user who is logged in?
- “Author” custom post type
- Display custom post front end filter by ACF equals current user
- Clone wp-admin/users.php (Users Admin Page)
- display post count in archive page that have relation with another taxonomy term
- how to display author name in custom post type
- How do I find the count of the current post?
- Get all of a user’s posts (custom post type) then get cumulative value of a specific meta_key value from those posts
- How to show custom post count in archive page
- Assign a Post to a User
- How do I get all authors posts of a custom post type outside loop
- Why is wp_list_authors not picking up Authors from CPT’s?
- Autofill advanced custom field with user data
- Delete Post by User
- Display posts on parent post if author coincides
- Author archive custom posts only?
- Reference field of users in custom post type
- Set a static page as a user profile page?
- Custom Post Hierarchy and users
- I want to link an author to everything from any post type that they publish on the website
- conditional based upon the count of current user’s published custom posts
- Creating multiple profiles under one user to assign to particular posts
- Get author image for posts in loop on custom type posts page
- Control what custom posts a user can see
- WordPress Author Posts Review After Every Change In The Same WordPress Post
- Counting custom post type with wp_count_posts returns an empty object
- Custom Post Type Author Array Problem
- Show a custom field instead of username in the backend author area
- Check in function on custom page
- How to display Author Profile based on Custom field value
- Emailing Authors only when a CUSTOM POST TYPE post is published- not when edited later [duplicate]