[wp-trac] [WordPress Trac] #42021: _update_posts_count_on_transition_post_status firing for incorrect post types
WordPress Trac
noreply at wordpress.org
Thu Sep 28 15:56:03 UTC 2017
#42021: _update_posts_count_on_transition_post_status firing for incorrect post
types
--------------------------------+-----------------------------
Reporter: sboisvert | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Networks and Sites | Version: 4.0
Severity: normal | Keywords:
Focuses: multisite |
--------------------------------+-----------------------------
In a Multisite environment the number of posts (of the posts post_type) is
tracked by update_posts_count(). This function will do a large select
query which can be pretty slow. The problem is that currently
_update_posts_count_on_transition_post_status() will trigger no matter
what post type is being transitioned, since update_posts_count() only
counts the posts post_type we don't need to trigger a count when a post of
another post_type is transitioning.
This patch adds the 3rd parameter to the
_update_posts_count_on_transition_post_status() and then does a check and
returns if the post is not the post post_type
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42021>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list