[wp-trac] [WordPress Trac] #27736: Save one query when inserting a new post
WordPress Trac
noreply at wordpress.org
Tue Dec 9 01:47:54 UTC 2025
#27736: Save one query when inserting a new post
-------------------------------------+-------------------------------------
Reporter: ozh | Owner: pbearne
Type: enhancement | Status: reopened
Priority: normal | Milestone: 7.0
Component: Posts, Post Types | Version: 3.0
Severity: normal | Resolution:
Keywords: has-patch has-unit- | Focuses: administration,
tests | performance
-------------------------------------+-------------------------------------
Changes (by westonruter):
* keywords: has-patch has-unit-tests close => has-patch has-unit-tests
* status: closed => reopened
* resolution: wontfix =>
* milestone: => 7.0
Comment:
Actually, reading the ticket description, I now see this:
> 2) first thing `wp_set_post_categories()` wants to know is `$post_type`
and `$post_status`, for which it performs an SQL query, instead of getting
this info from caller function
Maybe a better approach would be to call `update_post_cache()` so that
when `wp_set_post_categories()` runs it has access to to the `post_type`
and `post_status` in the object cache?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27736#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list