[wp-trac] [WordPress Trac] #63045: Add caching to `count_many_users_posts()`

WordPress Trac noreply at wordpress.org
Wed Oct 15 23:57:14 UTC 2025


#63045: Add caching to `count_many_users_posts()`
-------------------------------------------------+-------------------------
 Reporter:  flixos90                             |       Owner:
                                                 |  peterwilsoncc
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  6.9
Component:  Users                                |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests needs-      |     Focuses:
  testing                                        |  performance
-------------------------------------------------+-------------------------
Changes (by peterwilsoncc):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"60941" 60941]:
 {{{
 #!CommitTicketReference repository="" revision="60941"
 Users: Add caching to `count_many_users_posts()`.

 Introduces object caching to the `count_many_users_posts()` function.

 Argument equivalency is checked prior to generating the cache key to
 ensure that the same cache is hit regardless of array order for users and
 post types. For example `count_many_users_posts( [ 1, 2 ] )` will hit the
 same cache as `count_many_users_posts( [ 2, 1 ] )`.

 Props adamsilverstein, flixos90, kalpeshh, rollybueno, sachinrajcp123,
 shailu25, sirlouen, spacedmonkey, westonruter, wildworks.
 Fixes #63045.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63045#comment:24>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list