WordPress.org

Make WordPress Core

Opened 21 months ago

Last modified 18 months ago

#21431 closed enhancement

Allow count_many_users_posts() to count only public posts — at Version 2

Reported by: ryan Owned by:
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.4.1
Component: Users Keywords: has-patch do-not-punt commit
Focuses: Cc:

Description (last modified by ryan)

count_many_users_posts() calls get_posts_by_author_sql() which contains some cap checks. This makes the output dependent on the current user and thus not very cacheable. Let's add a means of counting only public posts that skips the cap and current user checks.

Change History (3)

ryan21 months ago

Core patch plus corresponding changes to a plugin to provide context

comment:1 ryan21 months ago

Patch courtesy of Barry.

comment:2 ryan21 months ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.