If you add this in the functions.php file in your themes folder:
add_filter('upload_dir', 'new_upload_dir');
function new_upload_dir( $param ){
$mydir="/wp-content/uploads";
$param['path'] = $param['path'] . $mydir;
$param['url'] = $param['url'] . $mydir;
error_log("path={$param['path']}");
error_log("url={$param['url']}");
error_log("subdir={$param['subdir']}");
error_log("basedir={$param['basedir']}");
error_log("baseurl={$param['baseurl']}");
error_log("error={$param['error']}");
return $param;
}
It should change the directory the images are uploaded into.
Related Posts:
- Limit Media Library to Given Folder
- Hide upload image fields for the different media upload popups
- I’m using add_meta_box() but want to include TinyMCE editor *and* Media Uploads for each box
- WordPress media uploader – upload tabs not hiding
- problem in uploading attachment to custom directory
- Can’t upload format files on media library
- How can I add a Description column to the media library browser screen?
- Rename UPLOADS folder with custom WP_CONTENT_DIR
- How to move wp-content (or uploads) outside of the WordPress directory
- Add more rows on media picker
- Automatically wrap post image in div
- media_handle_upload weird thing
- Looking to display non-image files in Gallery with logo specific to file type
- How do I go straight to “Edit More Details” when clicking on an item in the media library?
- Syncing Avatars across multisite
- How to re-arrange media uploaded using : media_handle_upload() as per year / month
- How to retrieve alt attribute for an attachment (uploaded image)?
- How to insert a sitemap within a subsite when using WordPress multisite
- Add a InfoBox in the media upload window
- custom upload directory only for plugin uploads
- Can I create my own custom Attachment Display Setting?
- Redirect to another page using contact form 7? [closed]
- Installing new theme on running site
- More Fields & Media Upload
- How to allow .bin files upload?
- Media Upload not working after hiding some elements from functions.php
- Personalized Gallery what are my options?
- the temporary save folder is wrong
- How to fix custom add menu page preventing media library from loading
- How do I enable the text editer in my WordPress theme? [closed]
- Is there a way to limit multi upload in media upload box?
- Organizing the Media Library for Cleanup
- Custom Link In WordPress Media “Attachment Details” Upload Screen
- How can I create more “create attachment” custom field – any idea?
- Upload files in wordpress
- Custom image sizes ignored in WP 3.5
- WordPress uploads directory. Featured Images storage
- Running Gutenberg React in Development Mode
- Is there a blank theme framework compatible with WP 3.0? [closed]
- Check for and enforce unique value in user-entered custom meta field in WP Admin
- Custom Search Query
- What might cause a POST to wp-admin/async-upload.php to return JSON >and< HTML?
- Enable / Add Custom Keyboard Shortcuts To Work With WordPress’ HTML Editor
- Managing Images for a WordPress Blog: Picasa or Flickr?
- What is causing this error? “Warning: Invalid argument”
- Modifying loop on a custom page, strange behaviour
- WordPress native “playlist” shortcode. Next and Prev there are but with no icons. How to fix?
- Show post page only if the user has bought a specific product
- Media_handle_upload with custom upload folder?
- custom headers for static home page and posts page
- How to order images in a post in WordPress 3.3?
- Best way to implement a thumbnail-based gallery in WordPress?
- How to remove buttons from the WP Editor on the edit post page in the admin area
- Customizer: Unique identifier that distinguishes which image upload control is uploading an image
- Allow only attachment uploaded to current post
- Different development environments (Mac & Windows)
- WordPress Locale Switching on Accept-Language Header
- How do I call in a category title on a category page in a child theme?
- Include custom JS without child theme
- how to convert Html block to dynamic widget?
- Create a User Role with permissions to only upload files to the media library?
- Multi-site User Sessions
- website with pretty permalinks except pagination
- How to create a control for css opacity in the Customizer
- How to change format of file link ( Name ) when insert from media uploder
- Possible to hook into Media Library preview File column and use a custom image?
- add an option to the read page
- Custom login and registration forms
- Save Textarea on WordPress Frontend
- How to custom post navigation
- how to add wp-user fields to front-end form
- Show custom field value as a link
- Customizing Comments
- More Fields: Input “Values (if applicable)” is disabled
- How do I make Dynamic Student Admission Form?
- WordPress not showing manually uploaded files in Uploads folder on Media Library
- Removing “Failed” query argument upon successful login
- How to get the full product name by ignoring custom modification on it
- Remove Category titles from individual posts on archive pages
- Moving Quantity after product description
- Calling get_theme_mod() of an WP_Customize_Image_Control() returns an Array, how do I correctly return the image src for my custom theme?
- Replace Vimeo and Youtube in from scratch theme with from-the-group-up single post template?
- Create single{custom}.php with data in table out of wp_posts
- Highlight specific user with custom field value
- How to define a static Home page
- let users add multiple divs in static page
- Best way to replace image url with source
- Missing Images in Uploads Directory (Server Only)
- Multiple Taxonomies Using Custom SQL Query
- Changing starting number of User ID
- Make Terms Under Custom Taxonomy Use Specific Single.php Template
- How to duplicate “Pages” section in the control panel?
- Pull certain WordPress posts on custom CMS instead and 301 wordpress to it?
- Create users via PHP
- Show post content in two different places without redirect
- Applying my own css classes in wp_menus 3?
- Show total sales for each products on search results page Woocommerce
- Permalink Listing WordPress
- Has the table name in SQL for WordPress changed from WP_posts to WPCS_post?
- “Media Library” shows as empty, despite images being present