In WordPress 5.7, a large handful of developer-focused changes were made that deserve to be called out. Let’s take a look!
Post statuses when counting term posts
The _update_post_term_count() function is responsible for querying the database for the number of objects belonging to a given term and updating the count property for that term in the database. However, the publish post status has been hard coded in the database query ever since it was introduced in  (except for when counting attachments, which always use the inherit status).
If a site wants to include posts with a different status in
World of WordPress is hosted by:
With Rocket, your websites will be blazing fast, always protected, and supported 24/7 by our experts with over 17 years of experience.