[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
Tue Jan 27 14:00:25 UTC 2026


#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 threadi):

 I also stumbled across this bug today. I received the wrong URL for
 wp_get_attachment_url(). My "solution":

 {{{
 $url = str_replace( ABSPATH, get_blogaddress_by_id( $blog_id ),
 get_attached_file( $post->ID ) );
 }}}

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


More information about the wp-trac mailing list