Use the upload_dir
filter.
add_filter( 'upload_dir', 'wpse_261931_upload_dir', 10, 1 );
function wpse_261931_upload_dir( array $uploads ) {
if( is_multisite() ) {
//* Do something interesting with the $uploads directory
}
return $uploads;
}
Related Posts:
- Shared upload folder in wordpress multisite with custom sub site domain pictures URL:s
- How to add Custom Blog Options to new blog setup form?
- Specific upload folder for PDFs in custom Post type in WP multisite
- Get upload URL by blog ID in multisite
- Multisite stuck at 1MB for max file size
- Which asset URLs are acceptable in a “vanilla” MU install?
- Can upload doc and pdf but not ppt – not permitted for security reasons
- WordPress Multisite: Adding actions to only one site
- Listing of all uploaded files in network sites
- WP Multisite: Adding pages on blog creation by default
- Perform action on WPMU blog deletion
- Upload path/URL weirdness for the main blog of a multisite/network setup
- Turn off ms-files.php after network setup
- Organize uploaded media files
- How can I have network sites not use year/month folders by default?
- How to upload images manually to wordpress?
- Sharding BLOGUPLOADDIR
- Advanced Custom Fields Multisite Upload/Imagery Issue [closed]
- WP Rest API – Upload media without saving attachment post
- How to make WordPress use new Upload Path settings in Multisite Setup
- Add site options UI in Multisite Sites > Infos page
- Uploading Images to Multi-Site Causes Failure to HTTP Error
- Shared upload folder in wordpress multisite
- Protect Uploads in Multisite
- WPMU Hook for archive or deactivate blog?
- .epub file blocked despite ALLOW_UNFILTERED_UPLOADS set to true
- How to get max upload size and accepted file types on multisite?
- Make default new sites https (multisite)
- WordPress Media mime type filter problem 4.0
- WordPress 3.2(Multisite) – How to add custom user meta fields to signup form?
- Force Uploads Use Yearmonth to off (0) for all existing sites in Multisites
- why when I try to insert an image attachment along with a post does wp_get_attachment_url give me a very wrong file path?
- Images uploading to wrong directory after changing to multisite
- Media library not loading after switching the main site of multisite
- How to stop unlink images when remove a site or user
- Multisite media library uploads broken images
- Hook up MU site creation
- Upload images from one site to another in Multisite
- Image problem – Multisite image upload broken
- Allow Author on Site A capability to upload files on Site B in Multi Site
- Upload file type not permitted even if explicitly registered as upload_filetypes in the db (multisite)
- Using wp_handle_upload() to Direct Specific Path by Using $overrides
- Where does multisite store image uploads?
- Error uploading files bigger than 58 MB
- WP doesn’t remove uploads from folder when removed from “Media Library”?
- Problem uploading images
- ‘Cheatin’ uh?’ Error When Attempting to Upload Images After 3.4 Update
- How to protect post attachments related to a custom post type, from non-logged in users, on 1 subsite of a multisite installation?
- Multisite – Images often getting uploaded to the wrong month directory
- Merge Multisites with Shared Network Media Library
- Limit entries number on network/sites.php
- Copying media from multisite subsites to main website
- Cannot use pre_set_site_transient_update_themes from within a theme in multisite
- Show media-frame-menu on custom Media Frame
- How to protect specific uploaded files from being accessed by non-logged-in users in WP-multisite
- Multisite sub-directories IIS 7.5 change media/uploads location
- Make uploads live outside of the WP folder
- Conditional Image Sizes for Use via Theme Customizer Upload Only
- Redirect to another page using contact form 7? [closed]
- Where to set individual blog quotas?
- Update blog option during create new blog?
- Save uploads directly in the uploads folder (on a multisite)
- Possible to hook into Media Library preview File column and use a custom image?
- Multisite adjust uploads like (/upload/%alphanumeric_id%/%file_type%/%blog_ID%)
- Automatically Insert Into Post when uploading Media
- Can I use the same Folder name as a Multisite Blog?
- Hiding media uploaded by other users in wordpress multisite?
- Multisite missing tmp folder error while uploading
- Filter Media by attached page or blog post in Library
- Multisite problem with unexisting paths to CSS etc
- Multisite subdirecty added inside URL to uploaded files
- How To Upload Existing WordPress Site To WordPress Multisite Using SSH
- Multisite – each site with it’s own set of users
- Remove multisite part from wordpress multisite upload directory
- What could cause wpmu_create_blog to throw “Already Installed” Error on multisite?
- How to set upload path after renaming uploads folder in Multisite?
- Which action hook to update custom field at network/site-info.php in multisite on update site info
- WordPress Multisite subdomains and sharing the same upload folder
- Do “switch_to_blog()” and “restore_current_blog()” re-run the filters?
- Domain mapping breaks some plugin scripts and css
- New wordpress uploads are broken
- Primary site file uploads failing, subdirectory subsites upload fine
- How to disable style filtering in post?
- personal_options hook on WordPress multisite
- Multi site and media uploader
- MP4 upload ok, but HTTP500 if I update the file (multisite)
- The wpmu_blogs_columns filter is not working
- Redirect to Multisite site 2 if site 1 has a setting
- How to hook into unregistering a widget instance?
- Multisite: use media from one site vs. copying the same media to all language sites?
- New Multisite Network: redirected you too many times
- the blog owner multisite
- Namespaced action and filter tags
- Modifying the comments section through a plugin regardless of theme
- Images give 404 after changing default domain
- How to use the sunrise.php script for Multisite network domain mapping?
- How to pull data from child installation to parent theme
- WordPress theme to support single website but with 3 sections for 3 languages
- Redirect www.mainsite.com/subsite/wp-login to www.mainsite.com/wp-login
- Can’t un-archive site after upgrading to WordPress 3.8