[wp-trac] [WordPress Trac] #39768: Incorrect image returned with attachment_url_to_postid()

WordPress Trac noreply at wordpress.org
Thu Feb 2 15:58:57 UTC 2017


#39768: Incorrect image returned with attachment_url_to_postid()
--------------------------+------------------------------
 Reporter:  ben.greeley   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  4.7.2
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by tristangemus):

 Welcome to core @ben.greeley

 From what I can see Wordpress is handling this correctly. If a duplicate
 is found using the same case or not, that image is appended with 1, 2, and
 so on. If you uploaded an image as untitled.jpg twice, then the second
 time around the URL you need to pass should have the be appended with -1.

 What's the use case where you're passing the original image URL even
 though Wordpress changes it before uploading?

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


More information about the wp-trac mailing list