Incorrect image URL for subsites when using UPLOADS constant on multisite subdirectory installation
|Reported by:||creativeinfusion||Owned by:|
Description (last modified by SergeyBiryukov)
If the UPLOADS constant is used on a Wordpress Multisite installed to subdirectory, using subdirectory mode, then image URLs for subsites are incorrect.
- WP MS installed to www.domain.com/wordpress, subdirectory not subdomain
- UPLOADS set to 'assets'
Main site uploads images to /wordpress/assets/...
Main site image URL is www.domain.com/wordpress/assets/...
- Create subsite called 'subsite';
- Subsite uploads images to /wordpress/assets/sites/2/...
- Subsite image URL is www.domain.com/subsite/assets/sites/2/... when it should be www.domain.com/assets/sites/2/...
This is because wp_upload_dir() uses get_option('siteurl') to derive the URL. It is probably right for subdomain multisite but wrong in this use case.