[wp-trac] [WordPress Trac] #25650: When switching between blogs, wp_upload_dir 'baseurl' and 'url' may be pointing to the current blog not the switched one

WordPress Trac noreply at wordpress.org
Thu Jun 5 13:05:03 UTC 2025


#25650: When switching between blogs, wp_upload_dir 'baseurl' and 'url' may be
pointing to the current blog not the switched one
--------------------------------------+-----------------------------
 Reporter:  igmoweb                   |       Owner:  ideag
     Type:  defect (bug)              |      Status:  assigned
 Priority:  normal                    |   Milestone:  Future Release
Component:  Upload                    |     Version:  3.6.1
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  multisite
--------------------------------------+-----------------------------

Comment (by ideag):

 Replying to [comment:32 johnjamesjacoby]:

 > Are we certain that’s where the bug lives? 😅
 Well, without this patch (line 6 in the table here:
 https://core.trac.wordpress.org/ticket/25650?replyto=32#comment:19)
 `content_url()` will use `get_option('siteurl')` from the *origninal*
 (incorrect) site, so it is part of the buggy behaviour.

 If the proposed solution is to to move that logic from `content_url()` and
 move it directly into `_wp_upload_dir()` directly, that would still solve
 the bug at the title, but `content_url()` would still be using the
 incorrect `WP_CONTENT_URL`, which is not ideal.

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


More information about the wp-trac mailing list