[wp-trac] [WordPress Trac] #42949: wp_attachment_is() forces the page to get new instance of post

WordPress Trac noreply at wordpress.org
Wed Dec 20 17:29:32 UTC 2017


#42949: wp_attachment_is() forces the page to get new instance of post
-------------------------------+-----------------------------
 Reporter:  bowlerman235       |      Owner:
     Type:  enhancement        |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Posts, Post Types  |    Version:  trunk
 Severity:  normal             |   Keywords:
  Focuses:  performance        |
-------------------------------+-----------------------------
 In the wp_attachment_is function, the signature allows for the post to be
 passed in as either ID or object. However, if you pass and an instance of
 a post object in, the current code forces you to retrieve another copy of
 the post object. It should use the object passed in to prevent unnecessary
 database calls.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42949>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list