Posted on: 08/29/21 09:52PM
There are two stages to a post being deleted: the first is being removed from the search results ("soft deleted") and placed in a queue for admins to review, and the second is an admin permanently removing it from the site. This is why it's possible for deleted posts to be restored. The count does get changed after a post is permanently deleted, just not when it's "soft" deleted. This is because admins can also immediately permanently delete posts. If we change the count when a post is soft-deleted instead of waiting until it gets permanently deleted, the count would never decrease for posts that are just immediately permanently deleted. Besides this, there are also a few quirks about the way that soft deletions work that make it so that having the count change upon soft delete would result in an even worse count for posts - you could end up with tags that have hundreds of posts showing a count of 0, for example.