[wp-trac] [WordPress Trac] #40072: URL from wp_get_attachment_image_src on multisite is wrong

WordPress Trac noreply at wordpress.org
Fri Nov 16 14:59:34 UTC 2018


#40072: URL from wp_get_attachment_image_src on multisite is wrong
-------------------------------------+------------------------------
 Reporter:  contremaitre             |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  General                  |     Version:  4.7.3
 Severity:  major                    |  Resolution:
 Keywords:  needs-patch 2nd-opinion  |     Focuses:
-------------------------------------+------------------------------
Changes (by antonioeatgoat):

 * keywords:   => needs-patch 2nd-opinion
 * severity:  normal => major


Comment:

 Hello @contremaitre, I faced it too yesterday. After some investigation I
 would add more details. It doesn't always return the url containing the
 domain of the main site, but with the domain of the site currently
 displaying.

 Example:

 I am on `site1.multisite.test` (id 2), \\
 I switch to `site2.multisite.test` (id 3), \\
 The url returned is: `http://site1.multisite.test/wp-
 content/uploads/sites/3`. \\
 The expected result would be instead `http://site2.multisite.test/wp-
 content/uploads/sites/3.

 I am going to write a patch for that.

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


More information about the wp-trac mailing list