[wp-trac] [WordPress Trac] #53443: The value of the `post_count` meta field is wrong because it doesn't get decremented when a post is deleted
WordPress Trac
noreply at wordpress.org
Thu Nov 18 15:10:32 UTC 2021
#53443: The value of the `post_count` meta field is wrong because it doesn't get
decremented when a post is deleted
--------------------------------------+------------------------
Reporter: henry.wright | Owner: audrasjb
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 5.9
Component: Posts, Post Types | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests | Focuses: multisite
--------------------------------------+------------------------
Changes (by audrasjb):
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"52207" 52207]:
{{{
#!CommitTicketReference repository="" revision="52207"
Posts, Post Types: Multisite: Decrement `post_count` option value when a
post is deleted.
Previously, the `post_count` option value was not decremented when a post
was deleted.
This change moves the `_update_posts_count_on_delete` action from
`delete_post` hook to `after_delete_post` to ensure the deletion is taken
into account.
Props henry.wright, pbearne, audrasjb.
Fixes #53443.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53443#comment:32>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list