[wp-trac] [WordPress Trac] #27736: Save one query when inserting a new post

WordPress Trac noreply at wordpress.org
Tue Dec 9 01:42:59 UTC 2025


#27736: Save one query when inserting a new post
-------------------------------------+-------------------------------------
 Reporter:  ozh                      |       Owner:  pbearne
     Type:  enhancement              |      Status:  closed
 Priority:  normal                   |   Milestone:
Component:  Posts, Post Types        |     Version:  3.0
 Severity:  normal                   |  Resolution:  wontfix
 Keywords:  has-patch has-unit-      |     Focuses:  administration,
  tests close                        |  performance
-------------------------------------+-------------------------------------
Changes (by westonruter):

 * status:  assigned => closed
 * resolution:   => wontfix
 * milestone:  Awaiting Review =>


Comment:

 I don't think this will be a good idea. In practice, the `WP_Post` may
 already be in the object cache, as evidenced by the performance
 improvement confusion when testing. Also, this relies on the caller
 providing the `$post_type` and `$post_status` that match whatever is for
 the provided `$post_id`. What if you provide something that is
 inconsistent? There's no longer a source of truth which we get by just
 relying on the `$post_id`. I concur that this should be closed.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/27736#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list