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
- Custom post type support for get_users(‘orderby=post_count’);
- Getting a list of custom posts by author
- Taxonomy count per Post type
- Display Authors Comments on Profile Page
- the_author_posts_link() for authors of custom post types
- Count posts or custom post types from last 24 hours (or from today)
- Front end registration/login & publish/update 1 custom post
- Adding %author% in custom post type URL structure?
- Count posts that have specific taxonomy term attached
- 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)?
- Count custom post types with a specific meta value
- 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
- Taxonomy list. Order by a specific custom post type count
- 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
- Prevent author role from editing all posts in custom post type?
- Display only custom post type count for current author on the “At a Glance” dashboard widget
- Community and User Generated Content Website: Have been thinking about Drupal but leaning on WordPress heavily
- Delete Current Author Frontend user while delete custom post type
- Total Word Count For Posts And Comments By One Author
- get_queried_object error How to show post count by month in the taxonomy page
- How to fetch custom post by Author?
- Check if author or current user has posts published
- How to count custom post types with conditional operators
- Get Author for Single Post in Custom Post Type
- How do I prefix blog post urls as mysite.com/blog/%postname%/ but allow authors to still be located at mysite.com/authors/%nicename%?
- Count posts with specific term_meta
- 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
- Count all comments of a custom post type
- How Can I Set the Post Author of a Post I Just Created With PHP?
- Custom Post Type and Labels
- Filter post by current 2 differents users id
- right_now_content_table_end function not working?
- WordPress count child posts of each parent custom post type and use in json array for google maps jquery plugin
- 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
- Query/list all terms and their custom post count
- 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
- Is using taxonomies the way to go here or would custom post types be better?
- Hiding posts by other users and non-logged in
- Post count by month of taxonmy term
- Permit users with author role to edit a custom post type
- URL rewrite add author as base
- custom post type category count shortcode
- Users create/join groups
- Disable user from updating certain posts
- Edit the author of custom post type
- Can multiple authors be assigned on a single custom post?
- Query posts based on the meta key values of logged-in users?
- Create custom post with custom user rules
- How to show featured image block in custom post type for Author?
- Associate multiple users to custom post type
- How to assign permissions for a CPT to a user
- How to display author post count for multiple custom post types?
- How can i display movies in profile page, added by an user?
- Author posts not appearing for custom post type
- Custom User role not working with custom post type
- Display an authors post on a single page only when they are logged in
- get comments by current user inside page template
- how to associate several authors to a custom post type
- Post loop count is not in order
- Assign post type to many users
- Check if user has comment on current post
- Select other roles as custom post authors
- Query within a foreach within a query (queryception)
- Author comment count in author page
- I am trying to get cutom post cout by month of current taxonmy term
- Showing User’s Post Counts by Custom Post Type in the Author.php?
- post body class for current user only if they are the post author
- how to count the current posts terms
- Restrict category access to specific users/groups. Author always has access
- Trying to add a class to post links
- How to count other posts not having specific taxonomy terms?
- WordPress Count posts within a custom post type
- Find custom post type url by author