[wp-trac] [WordPress Trac] #49685: Cached wp_count_posts() result may not contain all statuses
WordPress Trac
noreply at wordpress.org
Thu Jul 16 21:43:05 UTC 2020
#49685: Cached wp_count_posts() result may not contain all statuses
---------------------------------------------+-----------------------------
Reporter: obliviousharmony | Owner:
| obliviousharmony
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 5.5
Component: Posts, Post Types | Version: 5.4
Severity: minor | Resolution: fixed
Keywords: has-patch has-unit-tests commit | Focuses:
---------------------------------------------+-----------------------------
Changes (by whyisjake):
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"48497" 48497]:
{{{
#!CommitTicketReference repository="" revision="48497"
Posts, Post Types: Ensure that all post stati are countable in
`wp_count_posts`.
When `wp_count_posts()` is cached, it does so with all statuses defaulted
to 0. The problem is however, if this is called before all plugins have
registered their desired statuses, they won't have that default.
Fixes #49685.
Props obliviousharmony, SergeyBiryukov.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49685#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list