[wp-trac] [WordPress Trac] #28970: wp_get_attachment_url 0 === should be false ===

WordPress Trac noreply at wordpress.org
Mon Jul 21 05:51:30 UTC 2014


#28970: wp_get_attachment_url 0 === should be false ===
-------------------------------+------------------------------
 Reporter:  brashell           |       Owner:
     Type:  defect (bug)       |      Status:  closed
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Media              |     Version:  3.9.1
 Severity:  normal             |  Resolution:  invalid
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by brashell):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 Well I just realized I did {{{$file_return['url']}}} instead of
 {{{$file_return['file']}}} in wp_insert_attachment and how dumb that was.
 It made it so the _wp_attached_file was http://mainsite.com/subsite/wp-
 content/uploads/sites/2/sites/2/2014/07/Some-PDF.pdf instead of 2014/07
 /Some-PDF.pdf I am really sorry about this and for wasting your time, it
 was such a simple oversight. Now that I think about it, it might be a good
 idea to automatically fix this for people in the future. Remove the URL
 and leave just the path like its supposed to be. I guess I will just have
 to live and learn and this will help someone in the future hopefully.

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


More information about the wp-trac mailing list